#include <bits/stdc++.h>
using namespace std;
template <class T>
bool tomin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <class T>
bool tomax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
template <class T>
void read(T &x) {
  char c;
  x = 0;
  int f = 1;
  while (c = getchar(), c < '0' || c > '9')
    if (c == '-') f = -1;
  do x = (x << 3) + (x << 1) + (c ^ 48);
  while (c = getchar(), c >= '0' && c <= '9');
  x *= f;
}
bool mem1;
const double Pi = acos(-1);
const int maxn = 2e5 + 5;
int n;
char A[maxn];
bool solve() {
  if (n & 1) return 0;
  int cnt = 0;
  int l = 1, r = n;
  for (int i = n, i_ = 1; i >= i_; --i) {
    if (A[i] == ')')
      cnt++;
    else
      cnt--;
    if (cnt < 0) break;
    if (!cnt) r = i - 1;
  }
  cnt = 0;
  for (int i = 1, i_ = n; i <= i_; ++i) {
    if (A[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < 0) break;
    if (!cnt) l = i + 1;
  }
  if (!r) return 1;
  cnt = 0;
  if (A[l] == A[r]) return 0;
  for (int i = l + 1, i_ = r - 1; i <= i_; ++i) {
    if (A[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < 0) return 0;
  }
  return cnt == 0;
  int flag = 1;
  for (int i = l + 1, i_ = r; i <= i_; ++i) {
    if (A[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < 0) {
      if (flag)
        cnt++, flag = 0;
      else
        break;
    }
  }
  if (cnt == flag) return 1;
  cnt = 0;
  flag = 1;
  for (int i = r - 1, i_ = l; i >= i_; --i) {
    if (A[i] == ')')
      cnt++;
    else
      cnt--;
    if (cnt < 0) {
      if (flag)
        cnt++, flag = 0;
      else
        return 0;
    }
  }
  return cnt == flag;
}
bool mem2;
int main() {
  srand(time(NULL));
  read(n);
  scanf("%s", A + 1);
  puts(solve() ? "Yes" : "No");
  return 0;
}
