#include<iostream>
using namespace std;
char z[300];
char s[50];
int main(){
cin>>z;
int top=0,i=0;
while(z[i]!='@'){
if(z[i]=='('){
s[top++]=z[i];
}else if(z[i]==')'){
if(s[top-1]=='('){
top--;
}else{
top=1;
i++;
continue;
}
}
i++;
}
if(top==0){
cout<<"YES";
}else{
cout<<"NO";
}
return 0;
}