#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, f = 0;
  cin >> n;
  stack<long long> s;
  map<char, long long> m;
  string str;
  cin >> str;
  for (long long i = 0; i < str.size(); i++) {
    if (s.size() == 0 && str[i] == '(')
      s.push('(');
    else if (str[i] == ')' && m[')'] == 0)
      m[')']++;
    else if (s.size() != 0 && s.top() == '(' && str[i] == ')')
      s.pop();
    else if (str[i] == '(')
      s.push('(');
    else if (str[i] == ')')
      m[')']++;
    else if (str[i] = ')' && m[')'] > 1) {
      f = 1;
      break;
    }
  }
  if (f == 1 || s.size() != 1 || m[')'] != 1)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
