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.*;
import java.io.*;

public class Main {
    static int countr(char[]s){
        int ans=0;
        int b=0;
        for (int i =0;i<s.length;i++){
            if (s[i]==')') {
                if (b == 0)
                    ans++;
                else b--;
            }
            else b++;
        }
        return ans;
    }
    static int countl(char[]s){
        int ans=0;
        int b=0;
        for (int i =s.length-1;i>=0;i--){
            if (s[i]=='(') {
                if (b == 0)
                    ans++;
                else b--;
            }
            else b++;
        }
        return ans;
    }
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int[]r = new int[n];
        int[]l= new int[n];
        int curl=0;
        int curr=0;
        ArrayList<Integer>ids= new ArrayList<>();
        for (int i =0;i<n;i++){
            char[]s = sc.next().toCharArray();
            r[i]=countr(s);
            l[i]=countl(s);
            if (r[i]!=0&&l[i]!=0) {
                ids.add(i);
            }
            if (r[i]==0)
                curl+=l[i];
            if (l[i]==0)
                curr+=r[i];
        }
        boolean valid= true;
        Collections.sort(ids,(a,b)->r[a]-r[b]);

        PriorityQueue<Integer>pq = new PriorityQueue<>((a,b)->(l[b]-r[b])-(l[a]-r[a]));//take the seq that will make greater (left - right) diff
        int id=0;
        while (id<ids.size()&&valid){
            while (id<ids.size()&&curl>=r[ids.get(id)])
                pq.add(ids.get(id++));
            if (pq.isEmpty())
                break;
            int nxt =pq.poll();
            if (r[nxt]>curl){
                valid=false;
                break;
            }
            curl+=l[nxt]-r[nxt];
        }
        while (!pq.isEmpty()){
            int nxt =pq.poll();
            if (r[nxt]>curl){
                valid=false;
                break;
            }
            curl+=l[nxt]-r[nxt];
        }
        valid&=id==ids.size()&&curl==curr;
        pw.println(valid?"Yes":"No");
        pw.close();

    }
    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public int[] nextIntArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = Integer.parseInt(next());
            }
            return arr;
        }

    }

}
