using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static string[] SList(int n) => Enumerable.Repeat(0, n).Select(_ => ReadLine()).ToArray(); static void Main() { Solve(); } static void Solve() { var n = NN; var s = SList(n); WriteLine(Ref(n, s)); } static string Ref(int n, string[] s) { var maxlen = s.Max(si => si.Length); mul = new long[maxlen]; mul[0] = 1; for (var i = 1; i < mul.Length; ++i) mul[i] = mul[i - 1] * 31 % mod; mul2 = new long[maxlen]; mul2[0] = 2; for (var i = 1; i < mul2.Length; ++i) mul2[i] = mul2[i - 1] * 41 % mod2; var set = new Dictionary[maxlen]; for (var i = 0; i < set.Length; ++i) set[i] = new Dictionary(); var set2 = new Dictionary[maxlen]; for (var i = 0; i < set2.Length; ++i) set2[i] = new Dictionary(); var res = new bool[n]; for (var i = 0; i < n; ++i) { var h = Hash(s[i]); var h2 = Hash2(s[i]); var flg = false; var len = s[i].Length - 1; if (set[len].ContainsKey(h) && set2[len].ContainsKey(h2)) { if (set[len][h] == set2[len][h2]) flg = true; } for (var j = 0; j + 1 < s[i].Length; ++j) { if (flg) break; var sw1 = Swap(s[i], h, j); var sw2 = Swap2(s[i], h2, j); if (set[len].ContainsKey(sw1) && set2[len].ContainsKey(sw2)) { if (set[len][sw1] == set2[len][sw2]) flg = true; } } res[i] = flg; set[len][h] = s[i]; set2[len][h2] = s[i]; } return string.Join("\n", res.Select(f => f ? "Yes" : "No")); } static int mod = 1_000_000_009; static long[] mul = new long[0]; static long Hash(string a) { var res = 0L; for (var i = 0; i < a.Length; ++i) res = (res + (a[i] - 'a') * mul[i]) % mod; return res; } static long Swap(string a, long hash, int pos) { return (hash + (a[pos + 1] - a[pos] + mod) * mul[pos] % mod + (a[pos] - a[pos + 1] + mod) * mul[pos + 1] % mod) % mod; } static int mod2 = 1_110_000_019; static long[] mul2 = new long[0]; static long Hash2(string a) { var res = 0L; for (var i = 0; i < a.Length; ++i) res = (res + (a[i] - 'a') * mul2[i]) % mod2; return res; } static long Swap2(string a, long hash, int pos) { return (hash + (a[pos + 1] - a[pos] + mod2) * mul2[pos] % mod2 + (a[pos] - a[pos + 1] + mod2) * mul2[pos + 1] % mod2) % mod2; } }