#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  vector<char> v;
  cin >> s;
  int j = 0;
  for (int i = 0; i < n; i++) {
    v.push_back(s[i]);
    if (v.size() > 1) {
      if (v[j] == ')' && v[j - 1] == '(') {
        v.pop_back();
        v.pop_back();
        j -= 2;
      }
    }
    j++;
  }
  int c = 0, d = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i] == '(')
      c++;
    else
      d++;
  }
  if (c - d == 0 && c <= 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
