#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; string s; cin >> s; int open = 0; for(auto c : s){ if(c == ')') open--; else open++; if(open < 0){cout << "No\n"; return 0;} } if(open == 0) cout << "Yes\n"; else cout << "No\n"; }