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>
using namespace std;
const int N=1e6+10;
char s[N];
int n;
int totl,totr;
struct pos{
	int r,t;
	bool operator<(const pos &x)const{
		return r<x.r;
	}
};
struct neg{
	int l,t;
	bool operator<(const neg &x)const{
		return l<x.l;
	}
};
pos a[N];
neg b[N];
int numa,numb,l,r;
bool ans;
int main()
{
	//freopen("in.txt","r",stdin);
	scanf("%d",&n);
	for(int i=1,x,y;i<=n;++i){
		x=y=0;
		scanf("%s",s);
		for(int j=0;j<strlen(s);++j){
			if(s[j]=='(') ++x;
			else{
				if(x) --x;
				else ++y;
			}
		}
		totl+=x,totr+=y;
		if(x>=y) a[numa++]=(pos){y,x-y};
		else b[numb++]=(neg){x,y-x};
	}
	if(totl!=totr) printf("No\n");
	else{
		ans=false;
		sort(a,a+numa);
		sort(b,b+numb);
		for(int i=0;i<numa;++i){
			if(a[i].r<=l) l+=a[i].t;
			else{
				ans=true;
				break;
			}
		}
		for(int i=0;i<numb;++i){
			if(b[i].l<=r) r+=b[i].t;
			else{
				ans=true;
				break;
			}
		}
		if(ans) printf("No\n");
		else printf("Yes\n");
	}
}