#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string sa;
  cin >> sa;
  stack<char> s;
  s.push(sa[0]);
  for (int i = 1; i < n; i++) {
    if (s.empty())
      s.push(sa[i]);
    else {
      char top = s.top();
      if (top == '(' && sa[i] == ')')
        s.pop();
      else
        s.push(sa[i]);
    }
  }
  if (s.size() > 2 || s.size() == 1) {
    cout << "No" << endl;
  } else {
    if (s.empty())
      cout << "yes" << endl;
    else {
      char t1 = s.top();
      s.pop();
      char t2 = s.top();
      if (t1 == t2)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    }
  }
}
