#include<bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10 ;
char st[N] ;
int TOP = 0 ;
int main(){
cin>>st;
int len = strlen(st);/*
for (int i = 0 ; i < len ; ++i){
cout<<st[i];
}*/
for (int i = 0 ; i < len ; ++i){
if (st[i] == '@'){
break;
}
if (st[i] == '('){
++TOP;
}
if (st[i] == ')'){
--TOP;
}
}
if (TOP != 0){
cout<<"NO";
}
else{
cout<<"YES";
}
return 0 ;
}