#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int l = 0, r = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      l++;
    }
    if (s[i] == ')') {
      if (l > 0) {
        l--;
      } else {
        r++;
      }
    }
  }
  if (l == r && (l == 0 | l == 1)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
