#include<bits/stdc++.h>
using namespace std;
int main(){
stack<char>s;
char c;
while(cin>>c){
if(c=='('){
s.push(c);
}
if(c==')'){
if(!s.empty()){
if(s.top()=='('&&!s.empty()){
s.pop();
}
else{
cout<<"NO";
return 0;
}
}
}
}
if(s.empty()){
cout<<"YES";
}
else{
cout<<"NO";
}
}