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
import sys
input = sys.stdin.readline
n = int(input())
br = [input().rstrip() for i in range(n)]
ls = []
numsum = 0
charge = 0
for i in range(n):
  s = br[i]
  need = 0
  num = 0
  for t in s:
    if t == "(":
      num += 1
    else:
      num -= 1
    need = max(need,-num)
  numsum += num
  if need == 0:
    charge += num
  else:
    ls.append([need,num])
if numsum != 0:
  print("No")
  exit()
ls.sort()
l = len(ls)
vis = [0]*l
for i,x in enumerate(ls):
  need,num = x
  if need <= charge and num >= 0:
    charge += num
    ls[i][0] = -1
ls.sort(key = lambda x:x[0]+x[1],reverse=True)
for i in range(l):
  need,num = ls[i]
  if need == -1:
    continue
  if need > charge:
    print("No")
    exit()
  charge += num
print("Yes")