#include <bits/stdc++.h>
char str[200001];
int main() {
  int n, left = 0, right = 0, cnt = 0;
  scanf("%d", &n);
  scanf("%s", str + 1);
  if (n % 2 == 1)
    printf("No\n");
  else {
    for (int i = 1; i <= n; i++) {
      if (str[i] == '(')
        left++, cnt++;
      else
        right++, cnt--;
      if (cnt < -1) {
        printf("No\n");
        return 0;
      }
    }
    if (left != right) {
      printf("No\n");
      return 0;
    }
    printf("Yes\n");
  }
  return 0;
}
