#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int t = 0;
  bool used = false;
  for (int i = 0; i < n; ++i) {
    t += (s[i] == '(' ? 1 : -1);
    if (t < 0) {
      if (used) {
        cout << "No\n";
        return 0;
      } else {
        for (int j = i + 1; j < n; ++j) {
          swap(s[j - 1], s[j]);
        }
        t += 1;
        --i;
        used = true;
      }
    }
  }
  cout << (t == 0 ? "Yes" : "No") << '\n';
  return 0;
}
