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<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;

int n;
char s[1000005];
struct node1
{
	int a,b;
}x[1000005];
int cnt=0,c=0;
struct node2
{
	int a,b;
}y[1000005];
int st[1000005],top=0;
int sum=0,flag=0;

bool cmp1(node1 n,node1 m){return n.a+n.b>m.a+m.b;}
bool cmp2(node2 n,node2 m){return n.a<m.a;}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		int now=0;
		top=0;
		scanf("%s",s);
		int len=strlen(s);
		for(int j=0;j<len;j++)
		{
			if(s[j]==')'&&!top) now++;
			else if(s[j]=='(') top++;
			else top--;
		}
		int s,t;
		if(now!=0) s=now,t=top-now;
		else s=0,t=top;
		if(t<0) x[++cnt].a=s,x[cnt].b=t;
		else y[++c].a=s,y[c].b=t;
	}
	sort(x+1,x+cnt+1,cmp1),sort(y+1,y+c+1,cmp2);
	for(int i=1;i<=c;i++)
	{
		if(sum<y[i].a) flag=1;
		sum+=y[i].b;
	}
	for(int i=1;i<=cnt;i++)
	{
		if(sum<x[i].a) flag=1;
		sum+=x[i].b;
	}
	if(flag||sum) printf("No\n");
	else printf("Yes\n");
	return 0;
}