#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int present = 0;
  int mini = 2000000;
  char temp;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    if (temp == '(') {
      present++;
      mini = min(mini, present);
    } else {
      present--;
      mini = min(mini, present);
    }
  }
  if (present != 0) {
    cout << "No";
  } else {
    if (mini >= -1) {
      cout << "Yes";
    } else {
      cout << "No";
    }
  }
  return 0;
}
