#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 200003;
void solve() {
  int n;
  cin >> n;
  int cnt = 0;
  string s;
  cin >> s;
  bool don = 0;
  bool no = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < 0 && !don) {
      cnt++;
      don = 1;
    }
    if (cnt < 0) {
      no = 1;
      break;
    }
  }
  if (don) cnt--;
  if (cnt != 0) no = 1;
  if (no)
    cout << "No\n";
  else
    cout << "Yes\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
