#include<bits/stdc++.h>
using namespace std;
map<int,char> mp;
int main(){
stack<char> s;
char t;
while(t!='@'){
cin>>t;
s.push(t);
}
s.pop();
while(!s.empty()){
if(s.top()=='('){
mp['(']++;
s.pop();
}else if(s.top()==')'){
mp[')']++;
s.pop();
}else{
s.pop();
}
}
if(mp[')']==mp['(']){
cout<<"YES";
}else cout<<"NO";
}