#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int main() {
  {
    int n;
    string s;
    cin >> n >> s;
    if (n % 2)
      cout << "No" << endl;
    else {
      int c = 0, d = 0;
      bool ok = true;
      for (int i = 0; i < n; i++) {
        if (s[i] == '(')
          c++;
        else
          c--;
        if (c < -1) {
          ok = false;
          break;
        }
      }
      if (ok && c == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
