#include using namespace std; int main() { int Q; cin >> Q; string S = "aa"; string S2; S2.empty(); int type; char q; int l = 2; for(int i = 0; i < Q; i++){ cin >> type; if(type == 1){ cin >> q; S.push_back(q); S2.push_back(q); if(S.at(l) == ')' && S.at(l-1) == '|' && S.at(l-2) == '('){ S.erase(l-2,3); l -= 2; } else{ l++; } } else{ if(S.at(l-1) != ')' && S2.at(i-1) == ')'){ S.push_back('('); S.push_back('|'); l += 2; } else{ S.erase(l-1,1); l--; } } if(l == 2){ cout << "Yes" << endl; } else{ cout << "No" << endl; } } return 0; }