#8 RE了
#include<bits/stdc++.h>
#include <stack>
using namespace std;
int main(){
string a;
int i=0;
int left=0,right=0;
while(a[i]!='@'){
i++;
cin>>a[i];
if(a[i]=='(') left++;
if(a[i]==')') right++;
if(right>left) break;
}
if(left==right){
cout<<"YES";
}
else{
cout<<"NO";
}
return 0;
}