#include <bits/stdc++.h>
using namespace std;
string s;
bool pd(string s)
{
int n = 0;
for (int i = 0; s[i] != '@'; i++)
{
if (s[i] == '(')
n++;
else if (s[i] == ')')
{
if (n == 0)
return false;
else
n--;
}
}
if (n == 0)
return true;
else
return false;
}
int main()
{
cin >> s;
if (pd(s))
cout << "YES";
else
cout << "NO";
return 0;
}