#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long N;
  cin >> N;
  string cad;
  cin >> cad;
  long long last = -1;
  for (long long i = 0; i < N; i++) {
    if (cad[i] == ')') {
      last = i;
      break;
    }
  }
  if (last == -1) {
    cout << "No" << '\n';
    return 0;
  }
  cad.erase(last, 1);
  cad += ')';
  long long acum = 0;
  for (long long i = 0; i < N; i++) {
    if (cad[i] == '(')
      acum++;
    else
      acum--;
    if (acum < 0) {
      cout << "No" << '\n';
      return 0;
    }
  }
  if (acum != 0) {
    cout << "No" << '\n';
  } else {
    cout << "Yes" << '\n';
  }
  return 0;
}
