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; var set = new HashSet(); var res = new bool[n]; for (var i = 0; i < n; ++i) { var h = Hash(s[i]); var flg = false; if (set.Contains(h)) flg = true; for (var j = 0; j + 1 < s[i].Length; ++j) { if (flg) break; if (set.Contains(Swap(s[i], h, j))) flg = true; } res[i] = flg; set.Add(h); } 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; } }