#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int Q; cin >> Q; vector pool; vector X; X.push_back(-1); vector stk; for (int i = 0; i < Q; ++i) { int type; cin >> type; if (type == 1) { char c; cin >> c; int cur = pool.size(); pool.push_back(c); int prev = X.back(); int top = cur; stk.push_back(prev); bool deleted = false; if (c == ')' && prev != -1) { int mid = prev; if (pool[mid] == '|') { int btm = stk[mid]; if (btm != -1 && pool[btm] == '(') { top = stk[btm]; deleted = true; } } } X.push_back(top); } else { X.pop_back(); } if (X.back() == -1) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }