#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  if (n == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  cin >> s;
  int flag = 0, i, index = 0, count = 0;
  string ans;
  if (n % 2 == 1)
    ans = "No";
  else {
    for (i = 0; i < n; i++) {
      if (s[i] == '(') {
        index++;
        count++;
      } else {
        index--;
        count--;
      }
      if (index <= -1) {
        flag++;
        index = 0;
      }
    }
    if (flag > 1)
      ans = "No";
    else
      ans = "Yes";
    if (count != 0) ans = "No";
  }
  cout << ans << endl;
}
