#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
char s[N];
int arr[N];
int main() {
  int n;
  cin >> n;
  cin >> s;
  bool ok = true;
  int p = 0;
  for (int i = 1; i <= n; i++) {
    arr[i] = arr[i - 1] + (s[i - 1] == '(' ? 1 : -1);
    if (arr[i] < 0) {
      for (int j = i - 1; j < n; j++) {
        s[j] = s[j + 1];
      }
      s[n - 1] = ')';
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    arr[i] = arr[i - 1] + (s[i - 1] == '(' ? 1 : -1);
    if (arr[i] < 0) {
      cout << "No" << '\n';
      return 0;
    }
  }
  if (arr[n] == 0)
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
}
