#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
char stk[maxn];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int top = 0;
    char ch;
    for (int i = 1; i <= n; ++i) {
      scanf(" %c", &ch);
      if (ch == ')' && top && stk[top] == '(')
        --top;
      else
        stk[++top] = ch;
    }
    if (top == 0 || top == 2 && stk[1] == ')' && stk[2] == '(')
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
