#include<bits/stdc++.h>
using namespace std;
int kh[105],x,len,zuo,you;
string s;
int main() {
cin>>s;len=s.size();
for(int i=0;i<len;i++)
if(s[i]=='('||s[i]==')')x++,kh[x]=s[i];
for(int i=1;i<=x;i++){
if(zuo==0&&kh[i]==')'){
cout<<"NO";
return 0;
}if(kh[i]=='(')zuo++;
else zuo--;
}if(zuo==0)cout<<"YES";
else cout<<"NO";
return 0;
}