#include <bits/stdc++.h>
const int N = 1e6 + 10;
const int mod = 998244353;
using namespace std;
char a[N];
int main() {
  int n;
  scanf("%d%s", &n, a + 1);
  int c = 0, ff = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] == '(')
      c++;
    else
      c--;
    if (c == -1) ff++;
    if (c == -2) return 0 * puts("No");
  }
  if (c) return 0 * puts("No");
  puts("Yes");
  return 0;
}
