#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  if (n & 1) {
    cout << "NO\n";
    return 0;
  }
  long long c1 = 0, c2 = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == ')') {
      c2++;
    } else {
      c1++;
    }
  }
  if (c1 != c2) {
    cout << "NO\n";
    return 0;
  }
  c1 = 0;
  c2 = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == ')') {
      c2++;
    } else {
      c1++;
    }
    if (c2 - c1 > 1) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
}
