#include <bits/stdc++.h>
using namespace std;
char a[200005];
stack<char> s;
int main() {
  int n;
  scanf("%d", &n);
  scanf(" %s", a + 1);
  if (n & 1)
    printf("No\n");
  else {
    int cnt1 = 0, cnt2 = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i] == '(') {
        cnt1++;
        s.push(a[i]);
      } else {
        cnt2++;
        if (!s.empty() && s.top() == '(')
          s.pop();
        else {
          s.push(a[i]);
        }
      }
    }
    if (cnt1 != cnt2)
      printf("No\n");
    else {
      if (s.size() > 2)
        printf("No\n");
      else
        printf("Yes\n");
    }
  }
  return 0;
}
