#include #include using namespace std; int main(){ int N; string S; cin >> N; cin >> S; if (N%2==1){ cout << "No" << endl; return 0; } vector stack; for (int i=0; i0 && stack.back()=='(' && S[i]==')'){ stack.pop_back(); }else if (stack.size()>0 && stack.back()==')' && S[i]=='('){ stack.pop_back(); }else{ stack.push_back(S[i]); } } if (stack.empty()){ cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }