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;
inline void read (int &x) {
	char ch = getchar(); x = 0;
	while (!isdigit(ch)) ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
} const int N = 1e6 + 10;
int n, qwq; char ch[N]; int suma, sumb;
vector<pair<int, int> > va, vb;
signed main() {
	read (n);
	for (int i = 1; i <= n; ++i) {
		scanf ("%s", ch + 1);
		int s = 0, sa = 0, sb = 0, l = strlen (ch + 1);
		for (int j = 1; j <= l; ++j) {
			ch[j] == '(' ? ++s : --s;
			if (s < 0) sa -= s, suma -= s, s = 0;
		} sb += s, sumb += s;
		if (sa > sb) vb.push_back (make_pair (sb, sa));
		else va.push_back (make_pair (sa, sb)); 
	} if (suma != sumb) return puts ("No"), 0;
	sort (va.begin(), va.end()), sort (vb.begin(), vb.end());
	for (int i = 0; i < va.size(); ++i) {
		qwq -= va[i].first;
		if (qwq < 0) return puts ("No"), 0;
		qwq += va[i].second;
	} for (int i = vb.size() - 1; i >= 0; --i) {
		qwq -= vb[i].second;
		if (qwq < 0) return puts ("No"), 0;
		qwq += vb[i].first;
	} return puts ("Yes"), 0;
}