#include<bits/stdc++.h>
using namespace std;
stack <char> sk;
int main(){
char c;
while(cin>>c&&c!='@'){
if(c=='(')
sk.push(c);
else if(c==')'){
if(sk.empty()){
cout<<"NO"<<"\n";
return 0;
}
else
sk.pop();
}
}
if(!sk.empty())
cout<<"NO"<<"\n";
else cout<<"YES"<<"\n";
return 0;
}
03-02
422
08-24
1401
08-22
627
08-20
389