#include <bits/stdc++.h>
using namespace std;
int n;
char s[200005];
int A[200005];
int sum[200005];
int mn, id;
bool flg;
int main() {
  scanf("%d\n%s", &n, s);
  for (int i = 0; i < n; i++) {
    if (s[i] == '(')
      A[i + 1] = 1;
    else
      A[i + 1] = -1;
  }
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + A[i];
  flg = true;
  if (sum[n] != 0) {
    cout << "No";
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (sum[i] < 0) {
      flg = false;
      id = i;
      break;
    }
  }
  if (flg) {
    cout << "Yes";
    return 0;
  }
  for (int i = id; i < n; i++) A[i] = A[i + 1];
  A[n] = A[id];
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + A[i];
  flg = true;
  for (int i = 1; i <= n; i++) {
    if (sum[i] < 0) {
      flg = false;
      break;
    }
  }
  if (flg) {
    cout << "Yes";
    return 0;
  }
  cout << "No";
  return 0;
}
