#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
void solve() {
  stack<char> s;
  string t;
  int n, cr = 0;
  cin >> n >> t;
  for (int i = 0; i < n; ++i) {
    if (t[i] == ')') {
      if (s.empty()) {
        cr++;
      } else {
        s.pop();
      }
    } else {
      s.push('(');
    }
  }
  if (cr > 0) {
    if (!s.empty()) {
      s.pop();
      cr--;
    }
  }
  if (cr == 0 && s.empty()) {
    cout << "Yes";
  } else
    cout << "No";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int test = 1;
  while (test--) {
    solve();
    cout << '\n';
  }
  return 0;
}
