#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
string a;
stack<char> s;
int main() {
cin >> a;
for (int i = 0; i < a.size(); i++) {
if (a[i] == '(') {
s.push(a[i]);
}
if (a[i] == ')') {
if (s.top() == '(' and !s.empty()) {
s.pop();
}
}
}
if (s.empty()) {
cout << "YES";
return 0;
}
cout << "NO";
return 0;
}