#include<iostream>
#include<stack>
#include<string>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
cin>>s;
int l=0,r=0;
int i=0;
while(s[i]!='@')
{
if(s[i]'(')
{
l++;
}
if(s[i]')')
{
r++;
}
if(r>l)
{
cout<<"NO";
return 0;
}
i++;
}
if(l>r)
{
cout<<"NO";
}
else
{
cout<<"YES";
}
return 0;
}