#include using namespace std; int main() { int q; cin >> q; string s = ""; string t = ""; for(int i = 0; i < q; i++){ string query; cin >> query; if(query == "1"){ string c; cin >> c; s += c; t += c; }else{ s.pop_back(); if(t.size() > 0){ t.pop_back(); }else{ t = "(|"; } } if(t.size() >= 3){ if(t.substr(t.size() - 3) == "(|)"){ t = t.substr(0, t.size() - 3); } } if(t == ""){ cout << "Yes" << endl; }else{ cout << "No" << endl; } } }