#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 2e5 + 100;
char s[maxn];
int main() {
  scanf("%d%s", &n, s);
  int c = 0, cnt = 0, ans = 0x3f3f3f3f;
  for (int i = 0; i < n; i++)
    if (s[i] == '(') c++;
  if (c != n - c) {
    puts("No");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      cnt++;
    } else {
      cnt--;
      if (cnt < 0) ans = min(ans, cnt);
    }
  }
  puts(ans >= -1 ? "Yes" : "No");
  return 0;
}
