#include <bits/stdc++.h>
using namespace std;
int n, cnt, minn = (int)1e9;
char s[200005];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  if (n & 1) {
    puts("No");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      cnt++;
    else
      cnt--, minn = min(minn, cnt);
  }
  if (minn >= -1 && !cnt)
    puts("Yes");
  else
    puts("No");
  return 0;
}
