#include<iostream>
#include<stack>
#include<string>
using namespace std;
int main()
{
char s[1000];
int i=0;
cin>>s;
stack<char> t;
while(s[i]!='@') {
if (s[i]=='(') t.push(s[i]);
else {
if (s[i]=')') {
if (t.top()=='(') t.pop();
else {
cout<<"NO";
return 0;
}
}
}
i++;
}
if (!t.empty())cout<<"YES"; else cout<<"NO";
return 0;
}