#include <bits/stdc++.h>
using namespace std;
const long long N = 505, MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  string s;
  cin >> n >> s;
  int x = 0, num = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(')
      x++;
    else
      x--;
    num = min(num, x);
  }
  if (x == 0 && num >= -1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
