#include <bits/stdc++.h>
using namespace std;
const int mod = 100;
stack<int> s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  string str;
  cin >> n;
  cin >> str;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (str[i] == '(')
      s.push(0);
    else if (str[i] == ')' && (s.empty() || s.top() == 1))
      s.push(1);
    else if (str[i] == ')')
      s.pop();
  }
  if (s.empty())
    cout << "Yes" << endl;
  else {
    int s1 = s.top();
    s.pop();
    if (s.empty())
      cout << "No" << endl;
    else {
      int s2 = s.top();
      s.pop();
      if (s.empty()) {
        if (s1 == 0 && s2 == 1)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else
        cout << "No" << endl;
    }
  }
  return 0;
}
