Carpenters` Language#3284

Carpenters` Language

1 second
64 megabytes
Medium

International Carpenters Professionals Company (ICPC) is a top construction company with a lot of expert carpenters. What makes ICPC a top company is their original language.

The syntax of the language is simply given in CFG as follows:

S -> SS | (S) | )S( | ε

In other words, a right parenthesis can be closed by a left parenthesis and a left parenthesis can be closed by a right parenthesis in this language.

Alex, a grad student mastering linguistics, decided to study ICPC's language. As a first step of the study, he needs to judge whether a text is well-formed in the language or not. Then, he asked you, a great programmer, to write a program for the judgement.

Alex's request is as follows: You have an empty string in the beginning, and construct longer string by inserting a sequence of '(' or ')' into the string. You will receive queries, each of which consists of three elements (, , ), where is the position to insert, is the number of characters to insert and is either '(' or ')', the character to insert. For each query, your program should insert the character repeated times into the -th position of from the beginning. Also it should output, after performing each insert operation, "Yes" if is in the language and "No" if is not in the language.

Please help Alex to support his study, otherwise he will fail to graduate the college.

Input

The first line contains one integer (1 \le q \le 10^5) indicating the number of queries, follows lines of three elements, , , , separated by a single space (1 \le i \le q, c_i = '(' or ')', 0 \le p_i \le length of before -th query, 1 \le n \le 2^{20}). It is guaranteed that all the queries in the input are valid.

Output

For each query, output "Yes" if is in the language and "No" if is not in the language.

Examples

Example 1

Loading
Loading