#include <bits/stdc++.h>
using namespace std;
stack <char> s;
int d, e, b, c;
int main() {
char a;
while (a != '@') {
a = getchar();
if (a == '@') {
break;
}
s.push(a);
}
while (s.empty() == 0) {
if (s.top() == ')') {
d--;
while (e == 0) {
c=1;
e++;
}
}
if (s.top() == '(') {
d++;
while (e == 0) {
b=1;
e++;
}
}
s.pop();
}
if (d == 0) {
if (c == 0) {
cout << "NO";
} else {
cout << "YES";
}
} else {
cout << "NO";
}
}