#include using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; string s; cin >> s; int cnt = 0; for (char c : s) { if (c == '(') { cnt++; } else { cnt--; } if (cnt < 0) { cout << "No" << endl; return 0; } } if (cnt != 0) { cout << "No" << endl; return 0; } cout << "Yes" << endl; }