#include<bits/stdc++.h>
using namespace std;
string s;
bool flag=true;
int main()
{
cin>>s;
if(s[0]==')' || s[s.length()-2]=='('){
cout<<"NO";
return 0;
}
for(int i=0; i<s.length(); i++){
if(s[i]=='('){
int temp;
bool flag1=false;
for(int j=i; j<s.length(); j++){
if(s[j]==')'){
flag1=true;
temp=j;
break;
}
}
if(flag1){
s[i]=0;
s[temp]=0;
}
else{
flag=false;
break;
}
}
}
if(flag) cout<<"YES";
else cout<<"NO";
}