#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 30 * 1000 + 20;
const int MAXN = 30 * 1000 + 15;
const int MLOG = 18;
const int NMAX = 251;
int32_t main() {
  int n, ans = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    ans += s[i] - '(';
  }
  if (n % 2 || ans != n / 2) {
    cout << "NO";
  } else {
    for (int i = 0; i < n; i++) {
      if (s[i] == ')') {
        s.erase(s.begin() + i);
        break;
      }
    }
    s += ')';
    int dif = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '(') {
        dif++;
      } else {
        dif--;
      }
      if (dif == -1) {
        cout << "No";
        return 0;
      }
    }
    cout << "Yes";
  }
}
