#include<bits/stdc++.h>
using namespace std;
stack bool a;//自己加尖括号,打不出来
int main(){
char n;
bool f=1;
while(cin>>n&&n!='@'){
if(n==')'){
if(a.empty()) f=0;
else a.pop();
}
if(n=='(') a.push(1);
}
if(f&&a.empty()) cout<<"YES";
else cout<<"NO";
return 0;
}