#include<bits/stdc++.h>
using namespace std;
int main()
{
char s;
int a = 0,c = 0;
while(1)
{
s = getchar();
if (s == '@')
{
if(c == 0)
{
cout<<"YES";
}
else
{
cout<<"NO";
}
break;
}
if (s == ')')
{
c--;
}
if (s == '(')
{
c++;
}
if (c < 0)
{
cout<<"NO";
break;
}
if (a == 0&&s == ')')
{
cout<<"NO";
break;
}
}
return 0;
}