#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; string s; cin >> n >> s; bool ok = true; int cur = 0; for (char c : s) { if (c == '(') { cur++; } else { cur--; } if (cur < 0) ok = false; } if (cur != 0) ok = false; cout << (ok ? "Yes" : "No") << '\n'; return 0; }