Example

Input

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


Output

Yes
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

bool sorter(const P& a,const P& b){
  return a.fi<b.fi;
}

int n;
string s[111];
vector<P> ps[2];

int main(){
	cin.sync_with_stdio(false);
  cin>>n;
  rep(i,n)cin>>s[i];
  rep(i,n){
    int l=0,r=0;
    stack<char> st;
    rep(j,s[i].size()){
      if(s[i][j]=='(')st.push(s[i][j]);
      else{
        if(st.size()>0)st.pop();
        else l++;
      }
    }
    r=st.size();
    if(r-l>=0)ps[0].push_back(P(l,r));
    else ps[1].push_back(P(r,l));
  }
  sort(all(ps[0]),sorter);
  sort(all(ps[1]),sorter);
  int suma=0,sumb=0;
  rep(i,ps[0].size()){
    if(suma<ps[0][i].fi){
      cout<<"No"<<endl;
      return 0;
    }
    suma+=ps[0][i].se-ps[0][i].fi;
  }

  rep(i,ps[1].size()){
    if(sumb<ps[1][i].fi){
      cout<<"No"<<endl;
      return 0;
    }
    sumb+=ps[1][i].se-ps[1][i].fi;
  }
  if(suma==sumb){
    cout<<"Yes"<<endl;
  }else cout<<"No"<<endl;
	return 0;
}