#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int a[n];
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == '(') {
      a[i] = 1;
    } else
      a[i] = -1;
  }
  int ch = 0;
  stack<int> s;
  while (!s.empty()) s.pop();
  for (int i = 0; i < n; i++) {
    if (s.empty())
      s.push(a[i]);
    else {
      if (s.top() == 1 && a[i] == -1)
        s.pop();
      else
        s.push(a[i]);
    }
  }
  if (s.empty()) {
    cout << "YES";
    return 0;
  }
  while (!s.empty()) s.pop();
  for (int i = 0; i < n; i++) {
    if (s.empty() && a[i] == -1) {
      if (ch == 0) {
        ch = 1;
      } else {
        s.push(a[i]);
      }
    } else if (s.empty() && a[i] == 1) {
      s.push(a[i]);
    } else {
      if (a[i] == -1 && s.top() == 1)
        s.pop();
      else
        s.push(a[i]);
    }
  }
  int sz = 0, x;
  while (!s.empty()) {
    x = s.top();
    sz++;
    s.pop();
  }
  if (sz == 1 && x == 1 && ch == 1) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
}
