#include <bits/stdc++.h>
int main() {
  int n1;
  std::string s1;
  std::cin >> n1 >> s1;
  for (int i = 0; i < (int)s1.size(); i++)
    if (s1[i] == '(' && s1[i + 1] == ')') s1.erase(i, 2), i -= 2;
  if (s1.size() == 0 || s1.size() == 2 && s1[0] == ')' && s1[1] == '(')
    std::cout << "Yes";
  else
    std::cout << "No";
}
