#include <bits/stdc++.h>
using namespace std;
int read();
char s[1000006];
int main() {
  int n = read(), t = 0, pre = 0, cnt = 0;
  scanf("%s", s + 1);
  if (n & 1) return puts("No"), 0;
  for (int i = 1; i <= n; ++i) {
    int b = s[i] == '(';
    t += b;
    if (!b) {
      pre--;
      if (pre < 0) {
        if (cnt) return puts("No"), 0;
        cnt = 1, pre = 0;
      }
    } else
      pre++;
  }
  puts(t == n / 2 ? "Yes" : "No");
  return 0;
}
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') f = (c == '-') ? -1 : f, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
