#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int n, k, a[200005];
char str[200005];
int main() {
  scanf("%d", &n);
  scanf("%s", str + 1);
  int minx = 0;
  for (int i = 1; i <= n; i++) {
    if (str[i] == '(')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1] - 1;
    minx = min(minx, a[i]);
  }
  if (a[n] == 0 && minx >= -1)
    puts("Yes");
  else
    puts("No");
  return 0;
}
