#include <bits/stdc++.h>
using namespace std;
vector<int> v, vv, vv2;
int main() {
  long long t, n, a[1000], k, f = 0;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < s.size() && cnt >= -1; i++) {
    if (s[i] == '(')
      cnt++;
    else
      cnt--;
  }
  if (!cnt)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
