#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  stack<char> s1;
  int i = 0;
  while (i < s.size()) {
    if (s1.empty())
      s1.push(s[i++]);
    else if (s1.top() == '(' && s[i] == ')') {
      s1.pop();
      i++;
    } else
      s1.push(s[i++]);
  }
  string ss = "";
  while (!s1.empty()) {
    ss += s1.top();
    s1.pop();
  }
  if (ss == "" || ss == "()")
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
