#include <bits/stdc++.h>
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
using namespace std;
deque<bool> V;
int main() {
  int tcase = 1;
  for (int test = 1; test <= tcase; test++) {
    int n;
    scanf("%d", &n);
    string s;
    cin >> s;
    for (int i = 0; s[i] != '\0'; i++) {
      if (s[i] == '(') {
        V.push_back(0);
      } else {
        int l = V.size();
        if (l > 0) {
          if (V[l - 1] == 0 && l > 0) {
            V.pop_back();
          } else
            V.push_back(1);
        } else
          V.push_back(1);
      }
    }
    if (V.size() == 0) {
      printf("Yes\n");
    } else if (V.size() == 2) {
      if (V[0] != V[1]) {
        printf("Yes\n");
      } else {
        printf("No\n");
      }
    } else
      printf("No\n");
  }
}
