#include<bits/stdc++.h> using namespace std; string n; int i,top=0; int main(){ getline(cin,n); while(n[i]!='@'){ if(n[i]=='('){ top++; } if(n[i]==')'){ if(top==1) top--; else break; } i++; } if(top==0) cout<<"YES"; else cout<<"NO"; return 0; }