#include <bits/stdc++.h>
using namespace std;
unsigned long long n, co = 0, o = 0, c = 0;
string s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  cin.ignore();
  getline(cin, s);
  for (unsigned long long i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      o++;
      co++;
    } else if (s[i] == ')') {
      c++;
      co--;
    }
    if (co == -2) {
      break;
    }
  }
  if (co == 0 || co == -1 && o == c)
    cout << "Yes";
  else
    cout << "No";
}
