#include using namespace std; int main() { int N; cin >> N; vector P(N + 1); for (int i = 1; i <= N; i++) { string s; cin >> s; P[i] = s == "Yes"; } map, bool> memo; auto X = [&](auto&& X, int l, int r) -> bool { if (l == r) { return P[l]; } if (memo.count(make_pair(l, r))) { return memo[make_pair(l, r)]; } return memo[make_pair(l, r)] = P[l] == X(X, l + 1, r); }; for (int i = 1; i <= N; i++) { cout << (X(X, 1, i) ? "Yes\n" : "No\n"); } }