#include <iostream>
using namespace std;
struct stack
{
int n[1001], top;
stack()
{
memset(n, 0, sizeof n);
top = 0;
}
int pop()
{
if(top > 0)
return n[top--];
return 0;
}
void push(int x)
{
n[++top] = x;
}
bool empty();
}stk;
bool stack::empty()
{
if(top == 0)
return true;
return false;
}
int main()
{
bool flag = false;
string str;
cin >> str;
for(int i = 0; str[i] != '@'; i++)
{
if(str[i] == '(')
{
stk.push(1);
flag = true;
}
if(str[i] == ')')
{
flag = true;
if(stk.empty())
stk.push(2);
if(stk.n[stk.top] == 1)
stk.pop();
}
}
if(flag == false)
cout << "YES" << endl;
if(flag == true)
if(stk.empty())
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}