#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 2e5 + 4;
int main() {
  string s;
  int n;
  scanf("%d", &n);
  cin >> s;
  int pre[n], suf[n], minm = 0, bal = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      pre[i] = 1;
      suf[i] = -1;
    } else {
      pre[i] = -1;
      suf[i] = 1;
    }
    bal += pre[i];
    minm = min(minm, bal);
  }
  if (bal == 0) {
    if (minm > -2) {
      printf("Yes");
      return 0;
    }
  }
  printf("No");
}
