#include //#include using namespace std; //using namespace atcoder; //using mint = modint1000000007; //const int mod = 1000000007; //using mint = modint998244353; //const int mod = 998244353; //const int INF = 1e9; //const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i,l,r)for(int i=(l);i<(r);++i) #define rrep(i, n) for (int i = (n-1); i >= 0; --i) #define rrep2(i,l,r)for(int i=(r-1);i>=(l);--i) #define all(x) (x).begin(),(x).end() #define allR(x) (x).rbegin(),(x).rend() #define endl "\n" #define P pair template inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; } long long table[3][1000006]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vectormod; //mod.push_back(998244353); mod.push_back(1000000007); mod.push_back(1000000009); int sz = mod.size(); int base = 998244353; rep(i, sz)table[i][0] = 1; rep2(i, 1, 1000006) { rep(j, sz) table[j][i] = (table[j][i - 1] * base) % mod[j]; } //vector>st(sz); set

st; rep(i, n) { string s; cin >> s; vectorval(sz); rep(j, s.size()) { rep(k, sz) { val[k] += table[k][j] * (s[j] - 'a' + 1); val[k] %= mod[k]; } } bool chk = false; { if (st.count({ val[0],val[1] }))chk = true; //int cnt = 0; //rep(j, sz)if (st[j].count(val[j]))cnt++; //if (cnt == sz)chk = true; } rep(j, s.size() - 1) { vectorsubval(sz); rep(k, sz) { subval[k] = val[k]; subval[k] += mod[k] - table[k][j + 0] * (s[j + 0] - 'a' + 1) % mod[k]; subval[k] += mod[k] - table[k][j + 1] * (s[j + 1] - 'a' + 1) % mod[k]; subval[k] += table[k][j + 0] * (s[j + 1] - 'a' + 1); subval[k] += table[k][j + 1] * (s[j + 0] - 'a' + 1); subval[k] %= mod[k]; } if (st.count({ subval[0],subval[1] }))chk = true; //int cnt = 0; //rep(j, sz)if (st[j].count(subval[j]))cnt++; //if (cnt == sz)chk = true; } if (chk)cout << "Yes" << endl; else cout << "No" << endl; st.insert({ val[0],val[1] }); //rep(j, sz)st[j].insert(val[j]); } return 0; }