#include <bits/stdc++.h>
int main() {
  int n;
  char c;
  int result = 0;
  bool sign = false;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> c;
    if (c == '(') result += 1;
    if (c == ')') result -= 1;
    if (result < 0) {
      if (sign) {
        std::cout << "No";
        return 0;
      } else {
        sign = true;
        result += 1;
      }
    }
  }
  if (sign) result--;
  if (result != 0)
    std::cout << "No";
  else
    std::cout << "Yes";
  return 0;
}
