Example

Input

3
()(()((
))()()(()
)())(())


Output

Yes
/*
 * 2681.cc: Parentheses
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100;

/* typedef */

typedef pair<int,int> pii;
typedef vector<pii> vpii;

/* global variables */

vpii asc, dsc, pl;

/* subroutines */

bool cmp0(const pii &a, const pii &b) {
  return a.first > b.first || (a.first == b.first && a.second > b.second);
}

bool cmp1(const pii &a, const pii &b) {
  return a.first < b.first || (a.first == b.first && a.second > b.second);
}

/* main */

int main() {
  int n;
  cin >> n;

  int sumh = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int sn = s.size();
    int minh = 0, h = 0;
    for (int j = 0; j < sn; j++) {
      h += (s[j] == '(') ? 1 : -1;
      if (minh > h) minh = h;
    }
    //printf("%d: %d, %d\n", i, minh, h);

    if (h > 0) asc.push_back(pii(minh, h));
    else if (h < 0) dsc.push_back(pii(minh - h, h));
    else pl.push_back(pii(minh, h));
    sumh += h;
  }
  if (sumh != 0) {
    puts("No");
    return 0;
  }

  sort(asc.begin(), asc.end(), cmp0);
  sort(dsc.begin(), dsc.end(), cmp1);

  bool ok = true;
  int cur = 0;
  for (int i = 0; ok && i < asc.size(); i++) {
    ok = (cur + asc[i].first >= 0);
    cur += asc[i].second;
  }
  for (int i = 0; ok && i < pl.size(); i++) {
    ok = (cur + pl[i].first >= 0);
  }
  for (int i = 0; ok && i < dsc.size(); i++) {
    cur += dsc[i].second;
    ok = (cur + dsc[i].first >= 0);
  }

  cout << (ok ? "Yes" : "No") << endl;

  return 0;
}