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 ll long long
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 233;
pii a[maxn],b[maxn];
string s;
void shit(){
	puts("No");
	exit(0);
}
bool cmp(pii a,pii b){
	return a.fi-a.se>b.fi-b.se;
} 
int main()
{
 	ios::sync_with_stdio(false);
	int n,ca = 0,cb = 0,sum = 0;cin>>n;
	for(int i=1;i<=n;i++){
		a[i].fi = 0;a[i].se = 0;
		int cur = 0,mini = 0;
		cin>>s;
		for(int i=0;i<s.length();i++){
			if(s[i]=='(')cur++;
			else cur--;
			mini=min(mini,cur);
		}
//		cout<<cur<<" "<<mini<<endl;
		if(mini>=0){
			sum += cur;
		}
		else{
			if(cur>=0)a[++ca] = mp(-mini,cur);
			else b[++cb] = mp(cur,mini);
		}
	}
	sort(a+1,a+1+ca);
	for(int i=1;i<=ca;i++){
		if(sum-a[i].fi>=0){
			sum += a[i].se;
		}
		else{
			shit();
		}
	}
	sort(b+1,b+1+cb,cmp);
	for(int i=1;i<=cb;i++){
		if(sum+b[i].se<0){
			shit();
		}
		sum += b[i].fi;
	}
	if(sum==0)puts("Yes");
	else puts("No"); 
}
