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 java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	static class Updown implements Comparable<Updown>{
		int up;
		int minup;
		public Updown(int a , int b) {
			up = a;
			minup = b;
		}
		@Override
		public int compareTo(Updown o) {
			return o.minup - minup;
		}
	}
	static Updown calcUpdown(String bracket){
		int u = 0;
		int mu = 0;
		for(char c : bracket.toCharArray()){
			if(c == '('){
				++u;
			}else{
				--u;
				mu = Math.min(mu, u);
			}
		}
		return new Updown(u, mu);
	}
	
	static boolean checkNegative(List<Updown> updowns){
		int cur = 0;
		Collections.sort(updowns);
		for(Updown u : updowns){
			if(cur + u.minup < 0){
				return false;
			}
			cur += u.up;
		}
		return true;
	}
	static boolean canArrange(Updown uds[]){
		int tot = 0;
		List<Updown> lefts = new ArrayList<>();
		List<Updown> rights = new ArrayList<>();
		for(Updown u : uds){
			tot += u.up;
			if(u.up >= 0){
				lefts.add(u);
			}else{
				rights.add(new Updown(- u.up , u.minup - u.up));
			}
		}
		if(tot != 0){
			return false;
		}
		return checkNegative(lefts) && checkNegative(rights);
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Updown uds[] = new Updown[N];
		for(int i = 0 ; i < N ; ++i){
			String bracket = sc.next();
			Updown ud = calcUpdown(bracket);
			uds[i] = ud;
		}
		if(canArrange(uds)){
			System.out.println("Yes");
		}else{
			System.out.println("No");			
		}
	}
}
