#include <bits/stdc++.h>
using namespace std;
long long mod = pow(10, 9) + 7;
long long n, m, a[1000005], i, j, t, k;
long long prime[1000005] = {0};
vector<long long> vprime;
long long max3(long long a, long long b, long long c) {
  return max(a, max(b, c));
}
long long min3(long long a, long long b, long long c) {
  return min(a, min(b, c));
}
long long inv(long long x1, long long y1) {
  if (y1 == 0) return 1;
  long long temp = inv(x1, y1 / 2);
  temp = (temp * temp) % mod;
  if (y1 % 2) temp = (temp * x1) % mod;
  return temp;
}
long long inv1(long long a1, long long m1) {
  long long m0 = m1, x0 = 0, y0 = 1;
  if (m1 == 1) return 0;
  while (a1 > 1) {
    long long q = a1 / m1;
    long long temp = m1;
    m1 = a1 % m1;
    a1 = temp;
    temp = y0;
    y0 = x0 - q * y0;
    x0 = temp;
  }
  x0 = (x0 + m0) % m0;
  return x0;
}
void sieve() {
  for (i = 2; i < 1000; i++) {
    if (prime[i] == 0) {
      for (j = i * i; j <= 1000000; j += i) prime[j] = 1;
    }
  }
  for (i = 2; i < 1000001; i++) {
    if (prime[i] == 0) vprime.push_back(i);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  cin >> n;
  string s;
  cin >> s;
  if (n % 2 == 1) {
    cout << "No";
    return 0;
  }
  long long a1 = 0, b1 = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '(')
      a1++;
    else
      b1++;
  }
  if (a1 != b1) {
    cout << "No";
    return 0;
  }
  long long c = 0, ne = 0;
  for (i = 0; i < n; i++) {
    if (ne > 1) {
      cout << "No";
      return 0;
    }
    if (s[i] == '(')
      c++;
    else {
      if (c == 0)
        ne++;
      else
        c--;
    }
  }
  if (ne > 1)
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
