#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int counter = 0;
  cin >> n;
  string s;
  cin >> s;
  bool ok = true;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(')
      counter++;
    else
      counter--;
    if (counter < -1) {
      cout << "No";
      return 0;
    }
    if (counter < 0) {
      ok = false;
    }
  }
  if (counter == 0) {
    cout << "Yes";
  } else
    cout << "No";
  return 0;
}
