#include <bits/stdc++.h>
using namespace std;
string S;
long long N, i = 0;
int main() {
  cin >> N >> S;
  while (N-- and i + 2) {
    if (S[N] == ')')
      i++;
    else
      i--;
  }
  if (i)
    cout << "No";
  else
    cout << "Yes";
}
