#include<bits/stdc++.h>
using namespace std;
string a;
int top=0,top1=0;int b[999999],c[999999];
int main(){
getline(cin,a);
if(a[0]==')'){
cout<<"NO";
return 0;
}
int l=a.size()-2;
if(a[l]=='('){
cout<<"NO";
return 0;
}
for(int i=0;i<=l;i++){
if(a[i]=='('){
top++;
} if(a[i]==')'&&top>top1&&top!=0){
top1++;
}
}
if(top==top1){
cout<<"YES";
}else cout<<"NO";
return 0;
}```