#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long MOD = 998244353;
using ll = long long;
const int maxn = 2e6 + 555;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int len;
  string x;
  cin >> len >> x;
  int L = 0, R = 0;
  for (auto i : x) {
    if (i == '(')
      L++;
    else
      R++;
  }
  if (L != R) {
    cout << "No" << endl;
    return 0;
  }
  stack<char> s;
  int vain = 0;
  for (auto i : x) {
    if (i == '(')
      s.push(i);
    else if (!s.empty() && s.top() == '(')
      s.pop();
    else if (vain) {
      cout << "No" << endl;
      return 0;
    } else {
      vain = 1;
    }
  }
  if (!vain) {
    cout << "Yes" << endl;
    return 0;
  } else if (s.size() == 1 && s.top() == '(') {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
