#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  int k = 0, j = 0;
  string s;
  std::cin >> s;
  if (n % 2 != 0) {
    std::cout << "NO"
              << "\n";
    exit(0);
  } else {
    for (int i = 0; i < n; i++) {
      if (s[i] == '(')
        k++;
      else
        k--;
      if (k == -2) break;
    }
    if (k != 0)
      std::cout << "NO"
                << "\n";
    else
      cout << "YES"
           << "\n";
  }
  return 0;
}
