#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  string s;
  cin >> n >> s;
  bool use = false;
  vector<int> stack;
  for (int i = 0; i < n; i++) {
    if (s[i] == ')' && stack.empty() && use) {
      cout << "No"
           << "\n";
      return 0;
    }
    if (s[i] == ')' && stack.empty()) {
      use = true;
    } else if (s[i] == ')') {
      stack.pop_back();
    } else {
      stack.push_back(0);
    }
  }
  if (use && stack.size() == 1) {
    cout << "Yes"
         << "\n";
  } else if (!use && stack.empty()) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
}
