#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+1), k(26); rep(i,26) k[i] = rand(); set se; x[0] = 1; rep(i,1e6) 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 + k[s[j]-'a'] * x[m-j]) % MOD; bool ans = false; rep(j,m-1){ ll y = res - k[s[j]-'a'] * x[m-j] - k[s[j+1]-'a'] * x[m-(j+1)] + k[s[j]-'a'] * x[m-(j+1)] + k[s[j+1]-'a'] * x[m-j]; y = (y % MOD + MOD) % MOD; ans = ans + se.count(y); } se.insert(res); cout << (ans?"Yes\n":"No\n"); } return 0; }