#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  char s[t + 1];
  cin >> s;
  int temp = 0, c1 = 0, c2 = 0;
  int ans = 0;
  for (int i = 0; i < t; i++) {
    if (s[i] == '(') {
      c1++;
      temp++;
    } else {
      c2++;
      temp--;
    }
    if (temp < 0) {
      ans++;
      temp = 0;
    }
  }
  if (ans <= 1 && c1 == c2) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
