#include <cstdio>
#include <stack>
using std::stack;
const int N = 260;
char a[N];
int main(){
stack <char> s;
scanf("%s", a);
int i = 0;
while(a[i] != '@'){
if(a[i] == '(' ) s.push('(');
if(a[i] == ')'){
if(s.empty()){
printf("No");
return 0;
}else s.pop();
}
i++;
}
if(s.empty()) printf("YES");
else printf("NO");
return 0;
}