#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
void setIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
int main() {
  setIO();
  int n;
  cin >> n;
  string s;
  cin >> s;
  int bal = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      bal++;
    } else {
      bal--;
    }
    if (bal < -1) {
      cout << "No\n";
      return 0;
    }
  }
  cout << (bal == 0 ? "Yes" : "No") << '\n';
}
