#include using namespace std; using ll = long long; using P = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> n; const ll b = 524287, MOD = 998244353; vector x(1e6); set se; x[0] = 1; rep(i,1e6-1) x[i+1] = x[i] * b % MOD; rep(i,n){ string s; cin >> s; int m = s.size(); ll res = 0; rep(j,m) res = (res + s[j] * x[m-j]) % MOD; cout << (se.count(res)?"Yes\n":"No\n"); se.insert(res); rep(j,m-1){ ll y = res - s[j] * x[m-j] - s[j+1] * x[m-(j+1)] + s[j] * x[m-(j+1)] + s[j+1] * x[m-j]; y = (y % MOD + MOD) % MOD; se.insert(y); } } return 0; }