#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, count = 0;
  string s;
  cin >> n >> s;
  stack<long long int> S;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == ')') {
      if (!S.empty()) {
        S.pop();
      } else {
        count++;
      }
    } else {
      S.push(1);
    }
  }
  if (S.size() <= 1 && n % 2 == 0 && count <= 1) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
