#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  if (s.length() % 2 == 1) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long> sta;
  long long i = 0;
  long long f = 0;
  while (i < s.length()) {
    if (s[i] == '(')
      sta.push_back(1);
    else if (s[i] == ')') {
      if (sta.size() != 0)
        sta.pop_back();
      else {
        f++;
      }
    }
    i++;
  }
  if (f == 1 && sta.size() == 1) {
    cout << "Yes" << endl;
  } else if (!sta.size() && f == 0) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
