A bracket sequence is a string that is one of the following:

1. An empty string;
2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;
3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /



Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Constraints

* 1 \leq N \leq 10^6
* The total length of the strings S_i is at most 10^6.
* S_i is a non-empty string consisting of `(` and `)`.

Input

Input is given from Standard Input in the following format:


N
S_1
:
S_N


Output

If a bracket sequence can be formed by concatenating all the N strings in some order, print `Yes`; otherwise, print `No`.

Examples

Input

2
)
(()


Output

Yes


Input

2
)(
()


Output

No


Input

4
((()))
((((((
))))))
()()()


Output

Yes


Input

3
(((
)
)


Output

No
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

struct st{
	int c1,c2,Min1,Min2;
};
int main(){
	int n;cin>>n;
	vector<st>L,R;
	rep(i,n){
		string s;cin>>s;
		int c1=0,c2=0,Min1=0,Min2=0;
		for(char c:s){
			if(c=='(')c1++;
			else c1--;
			Min1=min(Min1,c1);
		}
		for(int i=s.size()-1;i>=0;i--){
			if(s[i]==')')c2++;
			else c2--;
			Min2=min(Min2,c2);
		}
		if(c1>=0)L.push_back({c1,c2,Min1,Min2});
		else R.push_back({c1,c2,Min1,Min2});
	}
	sort(L.begin(),L.end(),[](st a,st b){return a.Min1>b.Min1;});
	sort(R.begin(),R.end(),[](st a,st b){return a.Min2<b.Min2;});
	int cnt=0;
	for(auto s:L){
		if(cnt+s.Min1<0){puts("No");return 0;}
		cnt+=s.c1;
	}
	for(auto s:R){
		if(cnt+s.Min1<0){puts("No");return 0;}
		cnt+=s.c1;
	}
	if(cnt)puts("No");
	else puts("Yes");
}