#include <iostream>
#include <stack>
using namespace std;
typedef stack STACK;
int main(){
char c;
string str;
while(cin >> str) {
STACK st;
string::iterator s_it = str.begin();
int flag =0;
while(s_it != str.end()) {
if(*s_it == '(')
st.push(*s_it);
else {
if (!st.empty()) st.pop();
else {
cout << "NO"<<endl; flag =1; break;
}
}
s_it++;
}
if(flag !=1 && st.empty())
cout<<"YES" << endl;
else if(flag !=1 && !st.empty())
cout << "NO" <<endl;
}
return 0;
}