#include<iostream>
using namespace std;
#define N 20
char a[256];
bool judge(char c[])
{
int top=0,i=0;
while(c[i]!='@')
{
if(c[i]=='(')
{
top++;
}
if(c[i]==')')
{
top--;
}
i++;
}
if(top!=0)
return 0;
else
{
return 1;
}
}
int main()
{
cin>>a;
if(judge(a))
{
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
return 0;
}