#include <bits/stdc++.h>
using namespace std;
int n, l, r;
int main() {
  scanf("%d", &n);
  if (n % 2 != 0) {
    printf("No\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    if (c == '(')
      l++;
    else
      r++;
    if (r > l + 1) {
      printf("No\n");
      return 0;
    }
  }
  if (l != r) {
    printf("No\n");
    return 0;
  }
  printf("Yes\n");
  return 0;
}
