#include using namespace std; #define all(p) p.begin(), p.end() int main(){ int N; cin >> N; string S; cin >> S; int tmp = 0; int mim = 0; for (auto c : S){ tmp += (c == '(' ? 1 : -1); mim = min(mim, tmp); } cout << (tmp == 0 && mim == 0 ? "Yes\n" : "No\n"); }