#include <bits/stdc++.h>
using namespace std;
const int hashP = 239017;
const int N = 1e5 + 10;
const int MOD = 1e9 + 7;
const int MOD2 = 998244353;
const int INF = 1e9;
const long long INF2 = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  if (n % 2 == 1) {
    cout << "No";
    return 0;
  }
  int ans = 0;
  for (auto now : s) {
    ans += (now == '(' ? 1 : -1);
    if (ans < -1) {
      cout << "No";
      return 0;
    }
  }
  if (ans == 0 || ans == -1 || ans == 1)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
