#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int count = 0, wtf = 0, size;
  stack<char> data;
  char temp;
  cin >> size;
  if (size % 2 == 1) {
    cout << "No";
    return 0;
  } else {
    for (int i = 0; i < size; ++i) {
      cin >> temp;
      data.push(temp);
    }
    while (!data.empty()) {
      temp = data.top();
      data.pop();
      if (temp == ')')
        ++count;
      else if (temp == '(' && count > 0)
        --count;
      else
        ++wtf;
    }
    if (count <= 1 && wtf == 0)
      cout << "Yes";
    else if (count == 1 && wtf == 1)
      cout << "Yes";
    else
      cout << "No";
  }
  return 0;
}
