#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string str;
  cin >> str;
  long long cnt = 0, c = 0, mn = 0;
  if (str.length() % 2 == 1) return cout << "No\n", 0;
  for (long long i = 0; i < str.length(); i++) {
    if (str[i] == '(')
      c++;
    else {
      c--;
      if (c < mn) {
        cnt++;
        mn = c;
      }
    }
  }
  if (cnt <= 1 && c == 0) return cout << "Yes\n", 0;
  cout << "No\n";
  return 0;
}
