#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0, count1 = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == ')') {
      if (count > 0)
        count--;
      else
        count1++;
    } else
      count++;
  }
  if (count <= 1 && count1 <= 1 && n % 2 == 0) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
