#include <bits/stdc++.h>
using namespace std;
stack<char> s;
int main() {
  int one = 0, two = 0;
  int len;
  cin >> len;
  string x;
  cin >> x;
  if (len % 2 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < len; i++) {
    if (x[i] == '(')
      s.push('(');
    else {
      if (!s.empty()) {
        if (s.top() == '(')
          s.pop();
        else
          two++;
      } else
        two++;
    }
  }
  if (s.empty() && two == 0)
    cout << "Yes" << endl;
  else {
    while (!s.empty()) {
      if (s.top() == '(')
        one++;
      else
        two++;
      s.pop();
    }
    if (one == 1 && two == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
