#include<bits/stdc++.h>
using namespace std;
string s;
stack<char> q;
int main(){
cin>>s;
for(int i=0;i<s.length()-1;i++){
if(s[i]=='(') q.push(s[i]);
else if(s[i]==')' && !q.empty()) q.pop();
else{
cout<<"NO";
return 0;
}
}
if(q.empty()) cout<<"YES";
else cout<<"NO";
return 0;
}
给正确代码才关