#include <iostream>
#include <stack>
#include <string>
using namespace std;
int main(){
stack<int> s;
string a;
getline(cin,a);
for(int i = 0; i < a.size(); i++){
if(a[i]=='('){
s.push(a[i]);
}
if(a[i]==')'){
s.pop();
}
}
if(s.empty()){
cout<<"YES";
}else{
cout<<"NO";
}
return 0;
}
结果是测试点3,6,7,9是RE其他都AC