#include <bits/stdc++.h>
using namespace std;
int check[10000];
int main() {
  int n;
  string s;
  cin >> n >> s;
  stack<char> brac;
  for (int i = 0; i < n; i++) {
    if (!brac.empty() and s[i] == ')') {
      if (brac.top() == '(')
        brac.pop();
      else
        brac.push(s[i]);
    } else
      brac.push(s[i]);
  }
  if (brac.empty()) {
    cout << "Yes" << endl;
  } else if (brac.size() == 2) {
    char a = brac.top();
    brac.pop();
    char b = brac.top();
    brac.pop();
    if ((a == '(' and b == ')') or (a == '(' and b == ')'))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
