#include <bits/stdc++.h>
using namespace std;
int a, b, n;
int main() {
  scanf("%d", &n);
  getchar();
  for (register int i = 1; i <= n; ++i) {
    char ch = getchar();
    if (ch == '(') ++a;
    if (ch == ')') {
      if (a > 0)
        --a;
      else
        ++b;
    }
  }
  if ((a == 0 && b == 0) || (a == 1 && b == 1))
    puts("Yes");
  else
    puts("No");
  return 0;
}
