#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s;
  cin >> n;
  int minn = n, num = 0;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    if (s == '(')
      num++;
    else
      num--;
    minn = min(minn, num);
  }
  cout << ((num == 0 && minn >= -1) ? "Yes" : "No") << endl;
  return 0;
}
