#include<bits/stdc++.h> using namespace std; int S; int s; char x; int main(){ cin>>x; while(x!='@'){ cin>>x; if(x=='('){ S++; } if(x==')'){ s++; } if(s>S){ cout<<"NO"; return 0; } } if(S==s){ cout<<"YES"; } else{ cout<<"NO"; } return 0; }