{"raw_statement":[{"iden":"problem statement","content":"A **bracket sequence** is a string that is one of the following:\n\n1.  An empty string;\n2.  The concatenation of `(`, $A$, and `)` in this order, for some bracket sequence $A$ ;\n3.  The concatenation of $A$ and $B$ in this order, for some non-empty bracket sequences $A$ and $B$ /\n\nGiven are $N$ strings $S_i$. Can a bracket sequence be formed by concatenating all the $N$ strings in some order?"},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^6$\n*   The total length of the strings $S_i$ is at most $10^6$.\n*   $S_i$ is a non-empty string consisting of `(` and `)`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S_1$\n$:$\n$S_N$"},{"iden":"sample input 1","content":"2\n)\n(()"},{"iden":"sample output 1","content":"Yes\n\nConcatenating `(()` and `)` in this order forms a bracket sequence."},{"iden":"sample input 2","content":"2\n)(\n()"},{"iden":"sample output 2","content":"No"},{"iden":"sample input 3","content":"4\n((()))\n((((((\n))))))\n()()()"},{"iden":"sample output 3","content":"Yes"},{"iden":"sample input 4","content":"3\n(((\n)\n)"},{"iden":"sample output 4","content":"No"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}