#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p = 0;
  cin >> n;
  string s;
  cin >> s;
  bool ok = true;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '(')
      p++;
    else
      p--;
    if (p < -1) ok = false;
  }
  if (p != 0) ok = false;
  (ok) ? cout << "Yes" : cout << "No";
  return 0;
}
