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 mn=1e6+7;
string s,a[mn];
int n,cnt,l,r;

struct node {
	int la,ra;
}b[mn];

bool cmp(node a,node b)
{
	if(a.la-a.ra!=b.la-b.ra) return a.la-a.ra>b.la-b.ra;
	else return a.la<b.la;
}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i) {
		cin>>s;
		int top=0;
		for(int j=0;j<s.size();++j) {
			if(s[j]=='(') top++;
			else if(s[j]==')') {
				if(top) top--;
				else a[i]+=')';
			}
		}
		while(top) a[i]+='(',top--;
	}
	sort(a+1,a+n+1);
	
	int f=1;
//	for(int i=1;i<=n;++i) cout<<a[i]<<endl;
	for(int i=1;i<=n;++i) {
		if(a[i].size()==0) continue;
		if(a[i][0]==a[i][a[i].size()-1]&&a[i][0]=='(') {l+=a[i].size();continue;}
		if(a[i][0]==a[i][a[i].size()-1]&&a[i][0]==')') {r+=a[i].size();continue;}
		int la=0,ra=0;
		for(int j=0;j<a[i].size();++j) {
			if(a[i][j]=='(') la++;
			else ra++;
		}
		b[++cnt]=(node){la,ra};
	}
	sort(b+1,b+cnt+1,cmp);
	for(int i=1;i<=cnt;++i) {
		if(l>=b[i].ra) l+=b[i].la-b[i].ra;
		else f=0;
	}
	if(l!=r) f=0;
	puts(f?"Yes":"No");
}