#include <bits/stdc++.h>
using namespace std;
int n;
char buf[200200];
string s;
int main() {
  scanf("%d", &n);
  gets(buf), gets(buf);
  s = buf;
  int cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < -1) {
      printf("No\n");
      return 0;
    }
  }
  if (cnt != 0)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}
