#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin.ignore(10, '\n');
  string value;
  cin >> value;
  stack<char> brackets;
  for (const char& letter : value)
    if (brackets.size() && brackets.top() == '(' && letter == ')')
      brackets.pop();
    else
      brackets.push(letter);
  if (brackets.empty())
    cout << "Yes\n";
  else if (brackets.size() == 2) {
    const char& a = brackets.top();
    brackets.pop();
    if (a == brackets.top())
      cout << "No\n";
    else
      cout << "Yes\n";
  } else
    cout << "No\n";
}
