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.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        char[][] s = new char[n][];
        int[][] count = new int[n][4];
        int sum = 0;
        int sum2 = 0;
        for(int i=0;i<n;i++){
            s[i] = sc.next().toCharArray();
            count[i][2] = i;
            for(int j=0;j<s[i].length;j++){
                if(s[i][j]=='('){
                    count[i][0]++;
                    sum++;
                }else{
                    if(count[i][0] > 0){
                        count[i][0]--;
                    }else{
                        count[i][1]++;
                    }
                    sum2++;
                }
            }
            if(count[i][0] > 0 && count[i][1] > 0){
                count[i][3] = 2;
            }else if(count[i][0] > 0){
                count[i][3] = 1;
            }else if(count[i][1] > 0){
                count[i][3] = 3;
            }else{
                count[i][3] = 4;
            }

        }
        sc.close();
        if(sum!=sum2){
            System.out.println("No");
            return;
        }
        final int a = sum;
        Arrays.sort(count,new Comparator<int[]>() {
			@Override
			public int compare(int[] o1, int[] o2) {
                if(o1[3] == o2[3] && o1[3] == 2){
                    int a1 = o1[1]-a;
                    int a2 = o2[1]-a;
                    if(a1<=0 && a2<=0 || a1>=0 && a2>=0){
                        return (o2[0]-o2[1])-(o1[0]-o1[1]);
                    }else{
                        return o1[1]-o2[1];
                    }
                }else{
                    return o1[3] - o2[3];
                }
				
			}
        });
        sum = 0;
        for(int i=0;i<n;i++){
            if(count[i][3]==2){
                sum-=count[i][1];
                if(sum < 0){
                    System.out.println("No");
                    return;
                }
                sum+=count[i][0];
            }else{
                sum+=count[i][0];
                sum-=count[i][1];
                if(sum<0){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.println("Yes");


    }
    
}