#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
template <class nmsl>
inline void read(nmsl &x) {
  x = 0;
  char ch = getchar(), w = 0;
  while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  x = w ? -x : x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  string s;
  cin >> s;
  int op = 0;
  int clos = 0;
  int i;
  char ch;
  int f = 0;
  for (i = 0; i < s.length(); i++) {
    ch = s.at(i);
    if (ch == ')') {
      if (op == 0)
        f++;
      else
        op--;
    }
    if (ch == '(') op++;
    if (f > 1) break;
  }
  if (f == 2)
    cout << "NO"
         << "\n";
  else if (f == 1) {
    if (op == 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  } else {
    if (op == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
