#include<stack>
char x;
using namespace std;
int main(){
int l=0, r=0;
stack<char>a;
while (1) {
cin >> x;
if (x == '@') {
break;
}
if (x=='(') {
a.push(x);
l++;
}
else if (x == ')') {
r++;
if (a.top() == '(') {
a.pop();
}
}
}
if (r == l && a.empty()) {
cout << "YES"<<endl;
}
else {
cout << "NO"<<endl;
}
system("pause");
return 0;
}