#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  long long int n, i;
  string s;
  cin >> n >> s;
  vector<char> a;
  a.push_back(s[0]);
  for (i = 1; i < n; i++) {
    if (a.size() != 0 && a[a.size() - 1] == '(' && s[i] == ')') {
      a.pop_back();
    } else {
      a.push_back(s[i]);
    }
  }
  if (a.size() == 2) {
    if ((a[0] == '(' && a[1] == '(') || (a[0] == ')' && a[1] == ')')) {
      return cout << "No", 0;
    }
  }
  if ((a.size() == 2 || a.size() == 0)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
