Harry Potter is on a mission to destroy You-Know-Who's Horcruxes. The first Horcrux that he encountered in the Chamber of Secrets is Tom Riddle's diary. The diary was with Ginny and it forced her to open the Chamber of Secrets. Harry wants to know the different people who had ever possessed the diary to make sure they are not under its influence.

He has names of n people who possessed the diary in order. You need to tell, for each person, if he/she possessed the diary at some point before or not.

Formally, for a name s_{i} in the i-th line, output "YES" (without quotes) if there exists an index j such that s_{i} = s_{j} and j < i, otherwise, output "NO" (without quotes).


-----Input-----

First line of input contains an integer n (1 ≤ n ≤ 100) — the number of names in the list.

Next n lines each contain a string s_{i}, consisting of lowercase English letters. The length of each string is between 1 and 100.


-----Output-----

Output n lines each containing either "YES" or "NO" (without quotes), depending on whether this string was already present in the stream or not.

You can print each letter in any case (upper or lower).


-----Examples-----
Input
6
tom
lucius
ginny
harry
ginny
harry

Output
NO
NO
NO
NO
YES
YES

Input
3
a
a
a

Output
NO
YES
YES



-----Note-----

In test case 1, for i = 5 there exists j = 3 such that s_{i} = s_{j} and j < i, which means that answer for i = 5 is "YES".

Difficulty: EASY
Tags: String algorithms

Implementation

Complete search
Skill types: Complete search

Starter code:

Solutions:
def main():
	N = int(input())
	memo = set()
	for _ in range(N):
		s = input()
		print('YES' if s in memo else 'NO')
		memo.add(s)
main()


s = set()
for i in range(int(input())):
	n = input()
	print('YES' if n in s else 'NO')
	s.add(n)


n = int(input())
s = []
for i in range(n):
	stri = input()
	flag = 0
	for j in s:
		if stri == j:
			print('YES')
			flag = 1
	if flag == 0:
		print('NO')
		s.append(stri)


n = int(input())
result = []
visited = []
for i in range(n):
	a = input()
	if a in visited:
		result.append('YES')
	else:
		result.append('NO')
		visited.append(a)
for i in result:
	print(i)


n = int(input())
l = []
for i in range(n):
	s = input()
	if s in l:
		print('YES')
	else:
		l.append(s)
		print('NO')


n = int(input())
(s, k) = ([], [])
for i in range(n):
	l = str(input())
	if l in k:
		s.append('YES')
	else:
		s.append('NO')
	k.append(l)
for i in range(len(s)):
	print(s[i])


n = int(input())
d = {}
for i in range(n):
	x = input()
	if x in d:
		print('YES')
	else:
		d[x] = 1
		print('NO')


a = int(input())
mass = []
massa = []
for i in range(a):
	b = str(input())
	mass.append(b)
	massa.append(b)
mass[::-1]
massa[::-1]
for i in range(a):
	if mass.index(mass[i]) < i:
		massa[i] = 'Yes'
	else:
		massa[i] = 'No'
for i in massa:
	print(i)


n = int(input())
q = []
answer = []
for i in range(n):
	s = input()
	result = 0
	for j in q:
		if s == j:
			answer.append('YES')
			result = 1
			break
		else:
			continue
	if result != 1:
		answer.append('NO')
	q.append(s)
for i in answer:
	print(i)


first = []
for i in range(int(input())):
	second = input()
	if second not in first:
		print('NO')
		first.append(second)
	else:
		print('YES')


n = int(input())
l = []
while n > 0:
	x = input()
	if x in l:
		print('YES')
	else:
		print('NO')
	l.append(x)
	n = n - 1


used = set()
n = int(input())
for _ in range(n):
	s = input()
	print('YES' if s in used else 'NO')
	used.add(s)


n = int(input())
l = []
for _ in range(n):
	x = input()
	if x in l:
		print('YES')
	else:
		print('NO')
	l.append(x)


a = list()
n = int(input())
for i in range(n):
	s = input()
	if s in a:
		print('YES')
	else:
		print('NO')
	a.append(s)


n = int(input())
names = list()
k = 0
for i in range(0, n):
	names = names + [input()]
for i in range(0, n):
	for j in range(0, i):
		if names[i] == names[j]:
			k = k + 1
	if k > 0:
		print('YES')
	else:
		print('NO')
	k = 0


d = int(input())
l = []
for _ in range(d):
	e = input()
	if l.count(e) == 0:
		l.append(e)
		print('NO')
	else:
		print('YES')


s = []
ans = []
n = int(input())
for i in range(n):
	p = input()
	if p in s:
		ans.append('YES')
	else:
		ans.append('NO')
	s.append(p)
for i in ans:
	print(i)


n = int(input())
A = []
for i in range(n):
	A.append(input())
print('NO')
t = 0
for i in range(1, n):
	for j in range(i):
		if A[i] == A[j]:
			t = 1
			break
		else:
			t = 0
	if t:
		print('YES')
	else:
		print('NO')


n = int(input())
d = {}
for i in range(n):
	s = input()
	if not s in d:
		print('NO')
		d[s] = 1
	else:
		print('YES')


k = []
i = int(input())
for x in range(i):
	a = input()
	if a in k:
		print('YES')
	else:
		print('NO')
	k.append(a)


n = int(input())
l = []
k = []
for i in range(n):
	x = input()
	if x in l:
		k.append('YES')
	else:
		k.append('NO')
	l.append(x)
for i in range(n):
	print(k[i])


a = int(input())
s = set()
for i in range(a):
	c = input()
	if c in s:
		print('YES')
	else:
		s.add(c)
		print('NO')


def possesed_diary(names):
	possesed_already = set()
	for name in names:
		if name in possesed_already:
			print('YES')
		else:
			print('NO')
		possesed_already.add(name)
names = []
n = int(input())
for _ in range(n):
	names.append(input())
possesed_diary(names)


names = []
for n in range(0, int(input())):
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
		names.append(name)


n = int(input())
p = []
for i in range(n):
	q = input()
	if q in p:
		print('YES')
	else:
		p.append(q)
		print('NO')


import sys
n = int(sys.stdin.readline())
prenom = []
for loop in range(n):
	p = sys.stdin.readline()
	if p in prenom:
		print('YES')
	else:
		print('NO')
	prenom.append(p)


n = int(input())
a = list()
b = list()
i = 0
while i != n:
	c = input()
	a.append(c)
	if a.index(c) != i:
		b.append('YES')
	else:
		b.append('NO')
	i += 1
for i in b:
	print(i)


n = int(input())
arr = []
for i in range(n):
	s = input()
	if arr.count(s) != 0:
		print('YES')
	else:
		print('NO')
	arr.append(s)


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def solve(case_no):
	dict = {}
	n = int(input())
	for i in range(n):
		s = str(input())
		print('YES' if s in dict else 'NO')
		dict[s] = True
t = 1
for i in range(1, t + 1):
	solve(i)


n = int(input())
s = []
for i in range(n):
	x = str(input())
	if x in s:
		print('YES')
	else:
		print('NO')
		s.append(x)


n = int(input())
s = list()
otv = list()
for i in range(n):
	f = str(input())
	if f not in s:
		s.append(f)
		otv.append('NO')
	else:
		otv.append('YES')
for i in otv:
	print(i)


n = int(input())
li = []
for i in range(n):
	a = input()
	li.append(a)
for i in range(len(li)):
	if li[i] in li[0:i]:
		print('YES')
	else:
		print('NO')


seen = []
for _ in range(int(input())):
	s = input()
	if s in seen:
		print('YES')
	else:
		print('NO')
		seen.append(s)


n = int(input())
map = {}
for i in range(n):
	s = input()
	if s in map:
		print('YES')
	else:
		map[s] = 0
		print('NO')


n = int(input())
a = []
for i in range(1, n + 1):
	x = input()
	r = 'NO'
	for j in range(1, i):
		if x in a:
			r = 'YES'
	a.append(x)
	print(r)


n = int(input())
m = set()
mas = []
for i in range(n):
	mas.append(input())
for i in range(n):
	a = mas[i]
	if a in m:
		print('YES')
	else:
		print('NO')
		m.add(a)


n = int(input())
temp = []
for i in range(n):
	s = input()
	try:
		if temp.index(s) > -1:
			print('YES')
	except:
		temp.append(s)
		print('NO')


c = []
n = int(input())
for i in range(0, n):
	a = input()
	c.append(a)
print('NO')
for i in range(1, len(c)):
	flag = 0
	for j in range(0, i):
		if c[j] == c[i]:
			flag = 1
			print('YES')
			break
	if flag == 0:
		print('NO')


a = int(input())
b = []
for _ in range(a):
	c = str(input())
	if c in b:
		print('YES')
	else:
		print('NO')
	b.append(c)


ii = lambda : int(input())
s = []
for i in range(ii()):
	k = input()
	if k in s:
		print('YES')
	else:
		print('NO')
	s.append(k)


NumberOfPeople = input()
names = []
for eachname in range(int(NumberOfPeople)):
	names.append(input())
	if names[eachname] in names[0:eachname]:
		print('YES')
	else:
		print('NO')


n = int(input())
lst = []
for i in range(n):
	n1 = input()
	if n1 in lst:
		print('YES')
	else:
		print('NO')
	lst.append(n1)


l = []
for i in range(int(input())):
	a = input()
	if a not in l:
		print('NO')
		l.append(a)
	else:
		print('YES')


n = int(input())
a = 0
b = []
c = []
j = 'NO'
while a < n:
	a += 1
	i = input()
	if i in b:
		j = 'YES'
	if i not in b:
		j = 'NO'
	b.append(i)
	c.append(j)
for x in c:
	print(x)


n = int(input())
previous = []
answers = []
for i in range(n):
	current = input()
	if current in previous:
		answers.append('YES')
	else:
		previous.append(current)
		answers.append('NO')
for item in answers:
	print(item)


namelist = []
num = int(input())
for i in range(num):
	name = input().strip('\n\r')
	if name not in namelist:
		print('NO')
		namelist.append(name)
	else:
		print('YES')


d = set()
for s in [input() for i in range(int(input()))]:
	print('YES' if s in d else 'NO')
	d |= {s}


s = []
ans = []
n = int(input())
for i in range(n):
	s.append(input())
while len(s) != 0:
	x = s.pop()
	if x in s:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans[::-1]:
	print(i)


num = int(input())
names = []
for i in range(num):
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
		names.append(name)


r = []
l = []
for _ in range(int(input())):
	p = input()
	if p in l:
		r += ['YES']
	else:
		r += ['NO']
	l += [p]
for i in r:
	print(i)


n = int(input())
s = list()
c = {}
for _ in range(n):
	s.append(input())
for i in range(n):
	t = s[i]
	if t not in c:
		c[t] = 0
		print('NO')
	else:
		print('YES')


a = int(input())
b = set()
for x in range(a):
	g = input()
	print('NO') if not g in b else print('YES')
	b.add(g)


n = int(input())
k = []
for _ in range(n):
	s = input()
	if s in k:
		print('YES')
	else:
		print('NO')
		k.append(s)


i = int(input())
s = {}
for j in range(i):
	k = input()
	if k in s.keys():
		print('YES')
	else:
		print('NO')
		s[k] = 0
	i = i - 1


n = int(input())
dic = set()
for _ in range(n):
	s = input()
	print(['NO', 'YES'][s in dic])
	dic.add(s)


N = int(input())
s = set()
for i in range(N):
	x = input().strip()
	print('YES' if x in s else 'NO')
	s.add(x)


a = int(input())
b = []
for i in range(a):
	c = input()
	if c not in b:
		print('NO')
	else:
		print('YES')
	b.append(c)


people = int(input())
poss = set()
for k in range(people):
	p = input()
	if p in poss:
		print('YES')
	else:
		print('NO')
	poss.add(p)


n = int(input())
l = []
for i in range(n):
	l.append(input())
print('NO')
for i in range(1, n):
	c = 0
	for j in range(0, i):
		if l[i] == l[j]:
			c = 1
	if c == 1:
		print('YES')
	else:
		print('NO')


a = int(input())
s = {}
while a:
	b = input()
	if b in s.keys():
		print('YES')
	else:
		print('NO')
		s[b] = True
	a = a - 1


n = int(input())
visited = []
for i in range(n):
	stri = str(input())
	if stri not in visited:
		print('NO')
		visited.append(stri)
	else:
		print('YES')


a = []
for i in range(int(input())):
	a.append(input())
for i in range(len(a)):
	if a[i] in a[0:i]:
		print('YES')
	else:
		print('No')


n = int(input())
l = []
for i in range(n):
	a = input()
	if a in l:
		print('Yes')
	else:
		print('NO')
		l.append(a)


n = int(input())
l1 = [input() for i in range(n)]
l2 = []
for i in range(n):
	if l1[i] in l2:
		print('YES')
	else:
		print('NO')
		l2.append(l1[i])


n = int(input())
l = []
ans = [False] * n
for i in range(n):
	s = input()
	if s in l:
		ans[i] = True
	l += [s]
for i in ans:
	if i:
		print('YES')
	else:
		print('NO')


b = int(input())
w = []
ans = []
for i in range(b):
	s = input()
	if s in w:
		ans.append(1)
	else:
		ans.append(0)
		w.append(s)
for i in ans:
	if i:
		print('YES')
	else:
		print('NO')


t = int(input())
L = []
for i in range(t):
	w = input()
	if w in L:
		print('YES')
	else:
		print('NO')
		L.append(w)


n = int(input())
sl = []
for i in range(n):
	s = input()
	if s not in sl:
		print('NO')
		sl += [s]
	else:
		print('YES')


import math
import datetime
from sys import stdin
x = int(input())
dic = {}
res = ''
for l in range(x):
	r = input()
	if not r in dic:
		dic[r] = 1
		res += 'NO\n'
	else:
		res += 'YES\n'
print(res)


num = int(input())
d = dict()
for i in range(num):
	data = input()
	if data in d:
		print('YES')
	else:
		print('NO')
		d[data] = 0


a = int(input())
import math
b = []
for i in range(0, a):
	b.append(str(input()))
	if b.count(b[i]) > 1:
		print('YES')
	else:
		print('NO')


d = []
for ii in range(int(input())):
	s = input()
	if s not in d:
		d.append(s)
		print('No')
	else:
		print('Yes')


n = int(input())
l = []
s = input()
l.append(s)
print('No')
for i in range(n - 1):
	s = input()
	if s in l:
		print('Yes')
	else:
		print('No')
	l.append(s)


line = input()
qtd = int(line)
i = 0
vet = set()
while i < qtd:
	person = input()
	if person in vet:
		print('YES')
	else:
		print('NO')
	vet.add(person)
	i += 1


n = input()
n = int(n)
l = list()
for i in range(n):
	m = input()
	if str(m) in l:
		print('YES')
	else:
		print('NO')
		l.append(m)


no = int(input())
names = []
res = []
for i in range(no):
	s = input()
	if s in names:
		res.append('YES')
	else:
		res.append('NO')
	names.append(s)
for i in res:
	print(i)


t = int(input())
l = []
while t:
	t -= 1
	s = input()
	if s in l:
		print('YES')
	else:
		print('NO')
	l.append(s)


n = int(input())
names = []
non_repeated = []
for i in range(n):
	names.append(input())
for name in names:
	if non_repeated.__contains__(name):
		print('YES')
	else:
		non_repeated.append(name)
		print('NO')


n = int(input())
l = []
p = []
for i in range(n):
	l.append(input())
for i in l:
	if i not in p:
		p.append(i)
		print('NO')
	else:
		print('YES')


import sys
input = sys.stdin.readline
n = int(input())
d = set()
for _ in range(n):
	i = input().strip()
	if i in d:
		print('YES')
	else:
		print('NO')
	d.add(i)


from sys import stdin
n = int(input())
already_seen = set()
for name in stdin:
	if name in already_seen:
		print('YES')
	else:
		print('NO')
		already_seen.add(name)


d = {}
for i in range(int(input())):
	a = input()
	if a in d:
		print('YES')
	else:
		print('NO')
		d[a] = 0


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	n = I()
	a = [S() for _ in range(n)]
	s = set()
	r = []
	for c in a:
		if c in s:
			r.append('YES')
		else:
			r.append('NO')
			s.add(c)
	return '\n'.join(map(str, r))
print(main())


n = int(input())
names = []
for i in range(n):
	names.append(input())
m = []
for i in range(n):
	if names[i] in m:
		print('YES')
	else:
		print('NO')
	m.append(names[i])


n = int(input())
l = []
while len(l) < n:
	x = input()
	if x in l:
		print('YES')
		l.append(x)
	else:
		print('NO')
		l.append(x)


n = int(input())
a = set()
for i in range(n):
	s = input()
	if s in a:
		print('Yes')
	else:
		a.add(s)
		print('No')


from collections import defaultdict
freq = defaultdict(int)
n = int(input())
for _ in range(n):
	name = input()
	freq[name] += 1
	if freq[name] == 1:
		print('NO')
	else:
		print('YES')


n = int(input())
s = []
g = ''
for i in range(n):
	g = input()
	for j in s:
		if j == g:
			print('YES')
			break
	else:
		print('NO')
		s.append(g)


n = int(input())
noseque = {}
for i in range(n):
	persona = input()
	if persona in noseque:
		print('YES')
	else:
		noseque[persona] = 0
		print('NO')


n = int(input())
d = {}
for i in range(n):
	a = input()
	if d.__contains__(a):
		print('Yes')
	else:
		print('No')
		d.setdefault(a)


a = int(input())
b = set()
for i in range(a):
	c = input()
	print('NYOE S'[c in b::2])
	b.add(c)


n = int(input())
s = set()
sls = []
for i in range(n):
	sls.append(input())
for w in sls:
	if w in s:
		print('YES')
	else:
		print('NO')
		s.add(w)


n = int(input())
arr = [0] * n
for i in range(n):
	s = input()
	for j in range(i):
		if arr[j] == s:
			print('YES')
			break
	else:
		print('NO')
	arr[i] = s


from collections import Counter
n = int(input())
l = [0] * n
for _ in range(n):
	e = input()
	if e in l:
		print('Yes')
	else:
		print('No')
	l.append(e)


t = int(input())
dic = {}
for i in range(t):
	m = input()
	if m not in dic:
		dic[m] = 1
		print('NO')
	else:
		print('YES')


import sys
import math
import random
sys.setrecursionlimit(2000000)
t = int(input())
ar = []
for i in range(t):
	s = input()
	ar.append(s)
	times = ar.count(s)
	if times == 1:
		print('NO')
	else:
		print('YES')


x = int(input())
a = []
for i in range(x):
	a.append(input())
for i in range(x):
	k = 0
	for j in range(i, -1, -1):
		if j == i:
			continue
		if a[i] == a[j]:
			k = k + 1
	if k == 0:
		print('No')
	else:
		print('Yes')


a = int(input())
l = []
for i in range(0, a):
	s = input()
	l += [s]
for i in range(0, a):
	ans = 0
	for j in range(0, i):
		if l[i] == l[j] and i != j:
			ans += 1
	if ans:
		print('YES')
	else:
		print('NO')


n = int(input().strip(' '))
names = {}
cnt = 0
for _ in range(n):
	name = input().strip(' ')
	if name not in names:
		print('NO')
		names[name] = cnt
		cnt += 1
	else:
		print('YES')


n = int(input())
l = [input() for i in range(n)]
d = {}
s = ''
for x in l:
	if d.get(x, False):
		s += 'YES\n'
	else:
		s += 'NO\n'
		d[x] = 1
print(s[:-1])


dict = {}
for i in range(int(input())):
	s = input()
	if s not in dict:
		dict[s] = 1
		print('NO')
	else:
		print('YES')


n = int(input())
names = set()
for i in range(n):
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
	names.add(name)


n = int(input())
s = [input() for i in range(n)]
for (i, x) in enumerate(s):
	print('YES' if x in s[:i] else 'NO')


d = []
for i in range(int(input())):
	t = input()
	if t in d:
		print('YES')
	else:
		d.append(t)
		print('NO')


seen = set()
for _ in range(int(input())):
	inp = input()
	if inp in seen:
		print('YES')
	else:
		print('NO')
		seen.add(inp)


n = int(input())
list = []
for i in range(n):
	list.append(input())
list1 = []
for i in range(n):
	if list[i] not in list1:
		list1.append(list[i])
		print('NO')
	else:
		print('YES')


st = set()
for cas in range(int(input())):
	x = input()
	if x in st:
		print('YES')
	else:
		print('NO')
	st.add(x)


x = int(input())
diary = []
for i in range(x):
	l1 = input()
	if l1 in diary:
		print('YES')
	else:
		print('NO')
	diary.append(l1)


n = int(input())
ar = [input() for i in range(n)]
for i in range(n):
	if ar[0:i + 1].count(ar[i]) > 1:
		print('YES')
	else:
		print('NO')


n = int(input())
arr = []
while n != 0:
	s = input()
	arr.append(s)
	n = n - 1
for j in range(0, len(arr)):
	brr = arr[0:j]
	if arr[j] in brr:
		print('YES')
	else:
		print('NO')


n = int(input())
a = []
for i in range(n):
	st = input()
	if st not in a:
		a.append(st)
		print('NO')
	else:
		print('YES')


x = set()
for i in range(0, int(input())):
	s = input()
	if s in x:
		print('YES')
	else:
		print('NO')
	x.add(s)


n = int(input())
s = set()
for _ in range(n):
	x = input()
	if x not in s:
		print('NO')
		s.add(x)
	else:
		print('YES')


num_people = int(input())
people = []
for current_index in range(num_people):
	current_person = input()
	if current_person in people:
		print('YES')
	else:
		print('NO')
	people.append(current_person)


n = int(input())
a = set()
for i in range(n):
	s = input()
	if s in a:
		print('yes')
	else:
		a.add(s)
		print('no')


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
n = int(input())
a = []
for i in range(n):
	s = input()
	if s in a:
		print('YES')
	else:
		print('NO')
	a.append(s)


n = int(input())
names = []
i = 0
i2 = 0
ans = [0] * n
while n > i2:
	temp = input()
	temp2 = 0
	for j in range(i):
		if names[j] == temp:
			ans[i2] = 1
			temp2 = 1
			break
	if temp2 == 0:
		names += [temp]
		i += 1
	i2 += 1
for j in range(n):
	if ans[j] == 1:
		print('YES')
	else:
		print('NO')


n = int(input())
arr = []
for i in range(n):
	arr.append(input())
for i in range(n):
	f = 0
	for a in range(i):
		if arr[i] == arr[a]:
			print('YES')
			f = 1
			break
	if not f:
		print('NO')


t = int(input())
names = []
for i in range(t):
	names.append(input())
print('NO')
for i in range(1, len(names)):
	if names[i] in names[:i]:
		print('YES')
	else:
		print('NO')


from collections import defaultdict
hsh = defaultdict(int)
for i in range(int(input())):
	a = input()
	if hsh[a]:
		print('YES')
	else:
		print('NO')
		hsh[a] = 1


def checker(a=[]):
	print('NO')
	for i in range(1, len(a)):
		word = a[i]
		wasword = False
		j = i - 1
		while j >= 0:
			comparedword = a[j]
			if comparedword == word:
				wasword = True
				break
			j -= 1
		if wasword:
			print('YES')
		else:
			print('NO')
num = int(input())
a = []
for i in range(num):
	a.append(input())
checker(a)


n = int(input())
names = []
for i in range(n):
	s = str(input())
	if s not in names:
		print('NO')
		names.append(s)
	else:
		print('YES')


n = int(input())
l = []
for i in range(n):
	l.append(input().strip())
	ans = False
	for j in range(i):
		if l[i] == l[j]:
			ans = True
			break
	print('YES' if ans else 'NO')


nomes = {}
qtd = int(input())
for _ in range(qtd):
	nome = input()
	if nome not in nomes:
		nomes[nome] = True
		print('NO')
	else:
		print('YES')


num_of_inputs = int(input())
names_seen = []
for _ in range(num_of_inputs):
	name = input()
	if name in names_seen:
		print('YES')
	else:
		names_seen.append(name)
		print('NO')


n = int(input())
mass = []
for i in range(n):
	k = input()
	mass.append(k)
mass2 = []
mass2.append(mass[0])
print('NO')
for i in range(1, len(mass)):
	if mass[i] in mass2:
		print('YES')
	else:
		print('NO')
	mass2.append(mass[i])


n = int(input())
a = [1]
for i in range(n):
	f = 0
	s = input()
	a.append(s)
	for j in range(len(a) - 1):
		if a[j] == s:
			f = 1
			print('YES')
			break
	if f == 0:
		print('NO')


l = set()
c = 0
for _ in range(int(input())):
	l.add(input())
	print('YES' if len(l) <= c else 'NO')
	c = len(l)


def solution():
	n = int(input())
	seen = set()
	for _ in range(n):
		name = input()
		if name in seen:
			print('YES')
		else:
			print('NO')
			seen.add(name)
solution()


n = int(input())
res = []
for i in range(n):
	a = input()
	if a in res:
		print('YES')
	else:
		print('NO')
		res.append(a)


T = int(input())
l = []
for i in range(T):
	strin = input()
	if strin in l:
		print('YES')
	else:
		print('NO')
	l.append(strin)


n = int(input())
l = []
for i in range(n):
	x = str(input())
	l.append(x)
s = []
for i in range(n):
	if l[i] in s:
		print('Yes')
	else:
		print('No')
		s.append(l[i])


def solution(n, s):
	visited = {}
	for name in s:
		if name in visited:
			print('YES')
		else:
			visited[name] = 1
			print('NO')
n = int(input())
s = []
for i in range(n):
	s.append(input())
solution(n, s)


n = int(input())
a = []
ls = []
for i in range(n):
	s = input()
	if s in a:
		e = 'YES'
	else:
		e = 'NO'
	a.append(s)
	ls.append(e)
for i in ls:
	print(i)


n = int(input())
a = []
for i in range(n):
	a.append(str(input()))
print('NO')
for k in range(1, n):
	i = 0
	f = 0
	while i < k:
		if a[i] == a[k]:
			f += 1
		i += 1
	if f > 0:
		print('YES')
	else:
		print('NO')


def main():
	n = int(input())
	cache = {}
	while n > 0:
		curr = input()
		if curr in cache:
			print('YES')
		else:
			print('NO')
			cache[curr] = 1
		n -= 1
main()


x = int(input())
list1 = []
for i in range(0, x):
	s = input()
	if s not in list1:
		print('NO')
	else:
		print('YES')
	list1.insert(i, s)


from sys import stdin
n = int(stdin.readline())
data = set()
for i in range(0, n):
	name = stdin.readline()
	print('YES' if name in data else 'NO')
	data.add(name)


n = int(input())
l = []
for i in range(n):
	a = input()
	n = l.count(a)
	l.append(a)
	if n == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
main = []
visto = []
for i in range(t):
	n = input()
	main.append(n)
for j in main:
	if j not in visto:
		print('NO')
		visto.append(j)
	else:
		print('YES')


n = int(input())
names = []
for _ in range(n):
	s = input()
	names.append(s)
r = []
for name in names:
	if name not in r:
		r.append(name)
		print('NO')
	else:
		print('YES')


n = int(input())
l = []
for i in range(n):
	s = input()
	try:
		l.index(s)
		print('YES')
	except:
		print('NO')
	l.append(s)


n = int(input())
x = []
y = []
for i in range(n):
	x.append(input())
for i in range(n):
	if x[i] in y:
		print('YES')
	else:
		y.append(x[i])
		print('NO')


import sys
import math

def main():
	n = int(sys.stdin.readline().strip('\n'))
	name = []
	for _ in range(n):
		s = sys.stdin.readline().strip('\n')
		if s in name:
			print('YES')
		else:
			print('NO')
		name.append(s)
main()


n = int(input())
M = [input() for i in range(n)]
J = []
for i in range(len(M)):
	x = M[i]
	for j in range(len(M)):
		if x == M[j] and j < i:
			J.append('YES')
			break
		elif j >= i:
			J.append('NO')
			break
for i in J:
	print(i)


x = int(input())
y = []
b = []
c = []
for i in range(x):
	y.append(input())
for i in range(x):
	a = []
	for j in reversed(range(x)):
		if y[j] == y[i] and j < i:
			a.append('YES')
		else:
			a.append('NO')
	b.append(a)
for i in b:
	if 'YES' in i:
		c.append('YES')
	else:
		c.append('NO')
for i in c:
	print(i)


n = int(input())
seen = []
for i in range(n):
	string = input().strip()
	if string in seen:
		print('YES')
	else:
		print('NO')
		seen.append(string)


masukan = int(input())
nama = []
tampung = []
for i in range(masukan):
	x = input().split()
	nama += x
for i in range(masukan):
	if nama[i] not in tampung:
		tampung += nama[i].split()
		print('NO')
	else:
		print('YES')


import sys
n = int(input())
stringlist = []
result = []
for x in range(0, n):
	newstring = input()
	if newstring in stringlist:
		result.append('YES')
	else:
		result.append('NO')
		stringlist.append(newstring)
for x in result:
	print(x)


n = int(input())
diary = []
for i in range(n):
	names = input()
	if names in diary:
		print('Yes')
	else:
		print('No')
	diary.append(names)


l = []
for _ in range(int(input())):
	name = input()
	print('YES' if name in l else 'NO')
	l.append(name)


a = int(input())
b = list()
cou = list()
for i in range(0, a):
	c = input()
	flag = 0
	for fuq in b:
		if c == fuq:
			cou.append('YES')
			flag = flag + 1
			break
	if flag == 0:
		cou.append('NO')
	b.append(c)
for lel in cou:
	print(lel)


n = int(input())
d = {}
li = []
for i in range(n):
	s = input()
	if s not in li:
		d[s] = 1
		li.append(s)
	elif s in li:
		d[s] += 1
	if d[s] > 1:
		print('Yes')
	if d[s] == 1:
		print('NO')


n = int(input())
res = []
for i in range(n):
	res.append(str(input()))
final = []
for i in range(len(res)):
	flag = 0
	for j in range(len(res)):
		if j < i and res[i] == res[j]:
			flag = 1
			break
	if flag == 1:
		final.append('YES')
	else:
		final.append('NO')
for val in final:
	print(val)


n = int(input())
(x, o) = ([], [])
for i in range(0, n):
	a = input()
	x.append(a)
	if a in x[0:i]:
		o.append('YES')
	else:
		o.append('NO')
for i in o:
	print(i)


n = int(input())
a = []
for i in range(n):
	a.append(input())
for i in range(0, n):
	b = 0
	for j in range(0, i):
		if a[i] == a[j] and j < i:
			b = b + 1
	if b == 0:
		print('NO')
	else:
		print('YES')


num = int(input())
list_1 = []
if 1 <= num <= 100:
	for x in range(num):
		name = input()
		if name in list_1:
			print('YES')
		else:
			print('NO')
		list_1.append(name)


n = int(input())
names = ['0' for i in range(n)]
s = ''
for i in range(n):
	s1 = input()
	if s1 in names:
		s += 'YES\n'
	else:
		s += 'NO\n'
		names[i] = s1
print(s)


m1 = {}
for _ in range(int(input())):
	x = input()
	if x not in m1.keys():
		m1[x] = 1
		print('NO')
	else:
		print('YES')


params = int(input())
names = []
for inp in range(params):
	name = input()
	if names.count(name) > 0:
		print('YES')
	else:
		print('NO')
	names.append(name)


def main():
	n = int(input())
	s = set()
	for i in range(n):
		name = input()
		if name in s:
			print('YES')
		else:
			print('NO')
		s.add(name)

def __starting_point():
	main()
__starting_point()


names = []
for i in range(int(input())):
	name = input()
	if names.count(name) > 0:
		print('YES')
	else:
		names.append(name)
		print('NO')


n = int(input())
list1 = []
for i in range(n):
	list1.append(input())
for i in range(n):
	flag = False
	for j in range(i - 1, -1, -1):
		if list1[i] == list1[j]:
			flag = True
	if flag:
		print('YES')
	else:
		print('NO')


n = int(input())
ma = {}
for i in range(n):
	s = input()
	if s in ma.keys():
		print('YES')
	else:
		print('NO')
		ma[s] = 1


n = int(input())
b = []
a = []
for i in range(n):
	c = str(input())
	if c in a:
		b.append('YES')
	else:
		b.append('NO')
	a.append(c)
for i in range(len(b)):
	print(b[i])


stack = list()
for _ in range(int(input())):
	s = input()
	if s in stack:
		print('YES')
	else:
		print('NO')
		stack.append(s)


n = int(input())
d = {}
for _ in range(n):
	s = input()
	try:
		print(d[s])
	except KeyError:
		print('NO')
		d[s] = 'YES'


n = int(input())
w = set()
for i in range(n):
	x = input()
	if x in w:
		print('YES')
	else:
		print('NO')
	w.add(x)


l = []
ans = []
for i in range(int(input())):
	s = input()
	if s not in l:
		l.append(s)
		print('NO')
	else:
		print('YES')


n = int(input())
d = []
an = []
for i in range(n):
	s = str(input())
	d.append(s)
	if d.count(s) > 1:
		an.append('YES')
	else:
		an.append('NO')
print(*an, sep='\n')


number = int(input())
d = {}
for i in range(number):
	x = input()
	d[x] = d.get(x, 0) + 1
	if d[x] > 1:
		print('YES')
	else:
		print('NO')


n = int(input())
names = []
for i in range(n):
	x = input()
	if x not in names:
		print('NO')
		names.append(x)
	else:
		print('YES')


x = int(input())
s = []
for i in range(x):
	st = input()
	s.append(st)
print('NO')
for i in range(1, x):
	flag = 0
	for j in range(0, i):
		if s[i] == s[j]:
			flag = 1
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')


n = int(input())
names = {}
for _ in range(n):
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
		names[name] = True


n = int(input())
s = set()
ln = 0
for i in range(n):
	st = input()
	s.add(st)
	if ln != len(s):
		print('NO')
	else:
		print('YES')
	ln = len(s)


a = []
for _ in range(int(input())):
	temp = input()
	if temp in a:
		print('YES')
	else:
		print('NO')
	a.append(temp)


names = set()
for _ in range(int(input())):
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
		names.add(name)


n = int(input())
o = [''] * n
for i in range(n):
	s = input()
	if o.count(s) == 0:
		print('NO')
	else:
		print('YES')
	o += [s]


n = int(input())
dict = []
lis = []
for a in range(0, n):
	q = input()
	if q not in dict:
		dict.append(q)
		lis.append('NO')
	else:
		lis.append('YES')
for a in lis:
	print(a)


n = int(input())
z = []
for i in range(n):
	x = str(input())
	z.append(x)
(z1, z2) = (['NO'], [z[0]])
for i in range(1, n):
	if z[i] not in z2:
		z1.append('NO')
		z2.append(z[i])
	else:
		z1.append('YES')
		z2.append(z[i])
for i in range(len(z1)):
	print(z1[i])


def s():
	n = int(input())
	stri = []
	for i in range(n):
		temp = input()
		if temp in stri:
			print('YES')
		else:
			print('NO')
			stri.append(temp)
s()


n = int(input())
uniques = []
for i in range(n):
	s = input()
	if s not in uniques:
		print('NO')
	else:
		print('YES')
	uniques.append(s)


n = int(input())
s = []
for i in range(n):
	k = input()
	s.append(k)
for i in range(n):
	cheked = False
	for j in range(i):
		if s[i] == s[j]:
			cheked = True
	if cheked:
		print('YES')
	else:
		print('NO')


n = int(input())
names = []
for _ in range(n):
	newName = input()
	if newName not in names:
		print('NO')
		names.append(newName)
	else:
		print('YES')


n = int(input())
a = [input() for i in range(n)]
m = ['NO']
for i in range(1, n):
	for j in range(i):
		if a[i] == a[j]:
			m.append('YES')
			break
		elif i - j == 1:
			m.append('NO')
for i in m:
	print(i)


n = int(input())
list_ = []
for i in range(n):
	name = str(input())
	list_.append(name)
list1 = []
for j in list_:
	if j in list1:
		print('YES')
		list1.append(j)
	else:
		print('NO')
		list1.append(j)


people = set()
for i in range(int(input())):
	s = input()
	if s in people:
		print('YES')
	else:
		print('NO')
		people.update([s])


n = int(input())
l1 = []
for i in range(n):
	s = input()
	if s in l1:
		print('Yes')
	else:
		print('No')
	l1.append(s)


n = int(input())
s = []
for i in range(n):
	s.append(input().lower())
s1 = []
for i in range(n):
	sign = 0
	for j in range(len(s1)):
		if s1[j] == s[i]:
			sign = 1
	if sign == 1:
		print('YES')
	else:
		print('NO')
	s1.append(s[i])


n = int(input())
c = 0
a = [''] * n
for i in range(n):
	s = input()
	a[i] = s
for i in range(n):
	for j in range(i):
		if a[i] == a[j]:
			print('YES')
			c = 1
			break
	if c == 0:
		print('NO')
	c = 0


n = int(input())
people = []
lisofs = []
for i in range(n):
	s = input()
	if s in people:
		lisofs.append('YES')
	else:
		lisofs.append('NO')
		people.append(s)
for j in range(len(lisofs)):
	print(lisofs[j])


n = int(input())
p = []
for x in range(n):
	k = input()
	if k not in p:
		print('NO')
		p.append(k)
	else:
		print('YES')


def main():
	size = int(input())
	Se = set([])
	for i in range(size):
		s = input()
		if s in Se:
			print('YES')
		else:
			print('NO')
			Se.add(s)
main()


n = input()
lis = list()
m = int(n)
for i in range(m):
	k = input()
	lis.append(k)
kiss = list()
for i in range(m):
	if lis[i] in kiss:
		print('YES')
	else:
		print('NO')
		kiss.append(lis[i])


n = int(input())
d = {}
l = []
while n:
	s = input()
	x = d.get(s, 0)
	d[s] = 1
	l.append('NO' if x == 0 else 'YES')
	n = n - 1
print('\n'.join(l))


x = int(input())
L = []
X = {}
FLAG = 0
for i in range(x):
	FLAG = 0
	L.append(input())
	for j in range(i):
		if L[i] == L[j]:
			print('YES')
			FLAG = 1
			break
	if FLAG == 0:
		print('NO')


n = int(input())
l = [input() for _ in range(n)]
m = []
for i in l:
	if i not in m:
		print('NO')
		m.append(i)
	else:
		print('YES')


(data, result) = ([], [])
number = int(input())
for m in range(number):
	tem_data = input()
	if tem_data in data:
		result.append('YES')
	else:
		result.append('NO')
	data.append(tem_data)
for m in result:
	print(m)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	N = Scanner.int()
	s = set()
	for _ in range(N):
		S = Scanner.string()
		if S in s:
			print('YES')
		else:
			s.add(S)
			print('NO')

def main():
	solve()
main()


n = int(input())
s = set()
for i in range(n):
	str = input()
	has = 0
	for j in s:
		if j == str:
			has = 1
			break
	if has:
		print('YES')
	else:
		print('NO')
	s.add(str)


n = int(input())
ans = []
names = set()
for i in range(n):
	name = input()
	if name in names:
		ans.append('YES')
	else:
		ans.append('NO')
		names.add(name)
for a in ans:
	print(a)


def main():
	n = int(input())
	dct = set()
	for _ in range(n):
		s = input()
		if s in dct:
			print('YES')
		else:
			print('NO')
		dct.add(s)
	return 0
main()


IL = lambda : list(map(int, input().split()))
n = int(input())
pr = set()
for i in range(n):
	s = input()
	if s in pr:
		print('YES')
	else:
		print('NO')
		pr.add(s)


n = int(input())
names = []
answ = []
answ.append('NO')
names.append(input())
for i in range(n - 1):
	x = input()
	if x in names:
		names.append(x)
		answ.append('YES')
	else:
		answ.append('NO')
		names.append(x)
for i in range(len(answ)):
	print(answ[i])


def Diary():
	n = int(input())
	names = []
	for i in range(n):
		name = input()
		if name in names:
			print('YES')
		else:
			print('NO')
			names.append(name)
Diary()


n = int(input())
people = []
result = []
for i in range(n):
	human = input()
	if human in people:
		result.append('YES')
	else:
		result.append('NO')
		people.append(human)
for i in result:
	print(i)


n = int(input())
x = []
for N in range(n):
	s = input()
	x.append(s)
	ok = 0
	for j in range(N):
		if x[N] == x[j]:
			ok = 1
	if ok:
		print('YES')
	else:
		print('NO')


import math
n = int(input())
myMap = dict()
while n > 0:
	name = input()
	if myMap.get(name) == None:
		print('NO')
		myMap[name] = 1
	else:
		print('YES')
	n -= 1


n = int(input())
d = {}
for i in range(n):
	inp = input()
	if inp in d:
		print('YES')
	else:
		print('NO')
		d[inp] = i


x = int(input())
set1 = set()
for i in range(x):
	name = input()
	if name not in set1:
		set1.add(name)
		print('NO')
	else:
		print('YES')


n = int(input())
list = []
for i in range(n):
	t = input()
	if t in list:
		print('YES')
	else:
		print('NO')
		list.append(t)


n = int(input())
todos = []
for i in range(n):
	nome = input().strip()
	if nome in todos:
		print('YES')
	else:
		print('NO')
		todos.append(nome)


n = input()
n = int(n)
names = []
temp = []
for i in range(n):
	names.append(input())
	temp.append(0)
	for j in range(len(names) - 1):
		if names[i] == names[j]:
			temp[i] = 1
			break
for i in range(n):
	if temp[i] == 0:
		print('NO')
	else:
		print('YES')


n = int(input())
b = set()
for i in range(n):
	s = input()
	print('NYOE S'[s in b::2])
	b.add(s)


a = []
n = int(input())
for i in range(n):
	x = str(input())
	if x not in a:
		a.append(x)
		print('NO')
	else:
		print('YES')


numb = int(input())
l = []
d = []
for i in range(numb):
	a = input()
	if a in l:
		d.append('YES')
	else:
		l.append(a)
		d.append('NO')
for i in range(len(d)):
	print(d[i])


def main():
	v = set()
	for _ in range(int(input())):
		s = input()
		if s in v:
			print('YES')
		else:
			print('NO')
			v.add(s)
main()


n = int(input())
i = 0
q = []
while i < n:
	s = input()
	if s in q:
		print('YES')
	else:
		print('NO')
	q.append(s)
	i += 1


n = int(input())
L = []
for i in range(0, n):
	t = input()
	L.append(t)
R = []
V = []
for i in range(0, n):
	if L[i] in R:
		V.append('YES')
	else:
		V.append('NO')
		R.append(L[i])
for i in range(len(V)):
	print(V[i])


n = int(input())
res = []
names = []
for i in range(n):
	s = input()
	if s not in names:
		res.append('NO')
		names.append(s)
	else:
		res.append('YES')
for answer in res:
	print(answer)


f = lambda : map(int, input().split())
n = int(input())
s = []
for i in range(n):
	s.append(input())
	if i == 0:
		print('NO')
	elif s[-1] in s[:-1]:
		print('YES')
	else:
		print('NO')


n = int(input())
teljes = list()
volt = list()
for i in range(1, n + 1):
	teljes.append(input())
for i in range(0, n):
	if teljes[i] in volt:
		print('YES')
	else:
		volt.append(teljes[i])
		print('NO')


l = []
for i in range(int(input())):
	l.append(input())
	for j in range(i):
		if l[i] == l[j]:
			print('Yes')
			break
	else:
		print('No')


from sys import stdin

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()
a = []
for _ in range(ii()):
	s = si()
	if s in a:
		print('YES')
	else:
		print('NO')
		a.append(s)


a = int(input())
q = []
for i in range(a):
	s = input()
	if s in q:
		print('YES')
	else:
		q.append(s)
		print('NO')


N = int(input())
names = set()
T = 0
while T < N:
	T += 1
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
		names.add(name)


n = int(input())
a = set()
b = ''
for i in range(n):
	b = input()
	if b in a:
		print('YES')
	else:
		print('NO')
	a.add(b)


N = int(input())
D = []
h = 0
while N > 0:
	S = input()
	if S not in D:
		D.append(S)
		print('NO')
	else:
		print('YES')
	N = N - 1


n = int(input())
ans = []
name = []
for i in range(n):
	temp = input()
	if temp in name:
		ans.append('YES')
	else:
		ans.append('NO')
		name.append(temp)
for i in ans:
	print(i)


a = int(input())
b = [i for i in range(0, a)]
for j in range(0, a):
	b[j] = input()
for o in range(0, a):
	k = 0
	for y in range(0, o):
		if b[o] == b[y]:
			k = k + 1
			break
	if k:
		print('Yes')
	if k == 0:
		print('No')


n = int(input())
s = [0] * n
l = [0] * n
for i in range(n):
	s[i] = input()
for i in range(n):
	if s[i] in s[:i]:
		l[i] = 1
for e in l:
	if e == 1:
		print('YES')
	else:
		print('NO')


n = int(input())
dd = {}
for _ in range(n):
	l = input()
	if l in dd:
		print('YES')
	else:
		print('NO')
	dd[l] = 1


n = int(input())
tmp = []
for i in range(n):
	c = input()
	if c in tmp:
		print('YES')
	else:
		print('NO')
	tmp.append(c)


n = int(input())
l = []
for i in range(n):
	f = 0
	a = str(input())
	l.append(a)
	for j in range(i):
		if a == l[j]:
			f = 1
	if f == 1:
		print('YES')
	else:
		print('NO')


row = input().split(' ')
n = int(row[0])
v = []
j = []
for i in range(n):
	name = [input()]
	if name not in v:
		j.append('No')
		v.append(name)
	else:
		j.append('Yes')
print('\n'.join(j))


n = int(input())
d = dict()
for i in range(n):
	s = input()
	try:
		if d[s]:
			print('YES')
	except KeyError:
		d[s] = 1
		print('NO')


t = int(input())
names = []
for _ in range(t):
	names.append(input())
print('NO')
for i in range(1, t):
	s = names[i]
	flag = 0
	for j in range(i):
		if names[j] == names[i]:
			flag = 1
			print('YES')
			break
	if flag == 0:
		print('NO')


b = set()
for i in range(int(input())):
	c = len(b)
	b.add(input())
	if c == len(b):
		print('YES')
	else:
		print('NO')


a = int(input())
r = 0
b = list()
c = list()
while r < a:
	c.append(None)
	b.append(input())
	r = r + 1
(r, s) = (0, 0)
while r < a - 1:
	s = r
	while s < a - 1:
		if b[r] == b[s + 1]:
			c[s + 1] = 'YES'
		s = s + 1
	r = r + 1
if len(c) != a:
	c.append('NO')
r = 0
while r < a:
	if c[r] == 'YES':
		print(c[r])
	else:
		print('NO')
	r = r + 1


n = int(input())
a = input()
l = {}
for i in range(n - 1):
	if a not in l:
		print('NO')
		l[a] = 0
	else:
		print('YES')
	a = input()
if a not in l:
	print('NO')
	l[a] = 0
else:
	print('YES')


n = int(input())
list0 = []
for i in range(n):
	s = input()
	count = 0
	for i in list0:
		if i == s:
			count += 1
			break
	list0.append(s)
	if count >= 1:
		print('YES')
	else:
		print('NO')


import sys

def main():
	n = [int(x) for x in sys.stdin.readline().rsplit()]
	names = set()
	for line in sys.stdin.read().split('\n'):
		if len(line) == 0:
			continue
		if line in names:
			print('YES')
		else:
			print('NO')
			names.add(line)
main()


n = int(input())
names = []
for i in range(n):
	names.append(input())
uniquenames = []
for name in names:
	if name in uniquenames:
		print('YES')
	else:
		print('NO')
		uniquenames.append(name)


ar = [0]
for _ in range(int(input())):
	n = input()
	if n in ar:
		print('YES')
	else:
		print('NO')
	ar.append(n)


n = int(input())
a = []
b = []
for i in range(n):
	k = input() + '\n'
	if k in a:
		b.append('YES')
	else:
		b.append('NO')
	a.append(k)
for i in range(len(b)):
	print(b[i])


n = int(input())
mas = []
otv = []
r = False
for i in range(n):
	mas.append(input())
for i in range(n - 1, 0, -1):
	for j in range(i - 1, -1, -1):
		if mas[i] == mas[j]:
			otv.append('YES')
			r = True
		if r == True:
			r = False
			break
	else:
		otv.append('NO')
otv.append('NO')
otv.reverse()
for i in range(n):
	print(otv[i])


def main():
	N = int(input())
	S = tuple((input() for _ in range(N)))
	horcrux = set()
	for s in S:
		if s in horcrux:
			print('YES')
		else:
			print('NO')
			horcrux.add(s)
main()


n = int(input())
s = []
l = []
for _ in range(n):
	temp = input()
	s.append(temp)
for _ in range(n):
	if s[_] in l:
		print('YES')
	else:
		print('NO')
		l.append(s[_])


n = int(input())
lista = []
for i in range(n):
	nam = input()
	if nam in lista:
		print('YES')
	else:
		lista.append(nam)
		print('NO')


def main():
	n = int(input())
	existing = set()
	for _ in range(n):
		n = input()
		if n in existing:
			print('YES')
		else:
			existing.add(n)
			print('NO')
main()


x = []
y = []
test = int(input())
for i in range(test):
	x.append(input())
for i in x:
	if i not in y:
		y.append(i)
		print('No')
	else:
		print('Yes')


dic = {}
q = []
for i in range(int(input())):
	s = input()
	if s not in dic.keys():
		dic[s] = 0
		q.append('NO')
	else:
		dic[s] = 1
		q.append('YES')
for i in q:
	print(i)


t = int(input())
s = set()
for _ in range(t):
	str = input()
	if str in s:
		print('yes')
	else:
		print('no')
	s.add(str)


n = int(input())
d = {}
for i in range(n):
	x = input()
	print('YES' if x in d.keys() else 'NO')
	d[x] = 0


n = int(input())
l = []
for z in range(n):
	s = input()
	l.append(s)
a = ['NO']
c = 0
for i in range(1, n):
	c = 0
	for j in range(i):
		if l[j] == l[i]:
			c = 1
			break
	if c == 1:
		a.append('YES')
	else:
		a.append('NO')
for i in range(n):
	print(a[i])


i = input
A = []
tmp = {}
for j in range(int(i())):
	s = i()
	if tmp.get(s, -1) != -1:
		print('YES')
	else:
		print('NO')
		tmp[s] = 1


(n, s) = (int(input()), {''})
for _ in [0] * n:
	a = input()
	print(['NO', 'YES'][a in s])
	s.add(a)


array = []
for i in range(int(input())):
	s = input()
	if s in array:
		print('YES')
	else:
		print('NO')
	array += [s]


def solution(l1):
	i = 0
	s1 = set(l1)
	while i < len(l1):
		targ = l1[i]
		if targ in s1:
			s1.remove(l1[i])
			print('NO')
		else:
			print('YES')
		i += 1

def answer():
	n = int(input())
	l1 = []
	while n:
		l1.append(input())
		n -= 1
	solution(l1)
answer()


n = int(input())
s = list()
answers = ('NO', 'YES')
for i in range(n):
	name = input()
	print(answers[name in s])
	s.append(name)


n = int(input())
x = []
for i in range(n):
	s = input()
	x.append(s)
	if x.count(s) > 1:
		print('YES')
	else:
		print('NO')


n = int(input())
seen = set()
for _ in range(n):
	x = input()
	if x in seen:
		print('YES')
	else:
		print('NO')
		seen.add(x)


n = int(input())
names = []
for i in range(n):
	s = str(input())
	if names.count(s) == 0:
		print('NO')
	else:
		print('YES')
	names.append(s)


def list_input():
	return list(map(int, input().split()))

def map_input():
	return map(int, input().split())

def map_string():
	return input().split()
n = int(input())
s = set([])
for _ in range(n):
	x = input()
	if x in s:
		print('YES')
	else:
		print('NO')
	s.add(x)


from sys import stdin
n = int(next(stdin))
ns = []
for i in range(n):
	s = next(stdin).strip()
	if s in ns:
		print('YES')
	else:
		ns.append(s)
		print('NO')


x = input()
x = int(x)
lista = []
listb = []
for a in range(0, x):
	b = input()
	if b in lista:
		listb.append('YES')
	else:
		listb.append('NO')
	lista.append(b)
print(*listb, sep='\n')


n = int(input())
li = []
while n:
	n -= 1
	s = input()
	li.append(s)
x = -1
answer = []
for _ in li:
	y = li[x]
	if y in li[:x]:
		answer.append('YES')
	else:
		answer.append('NO')
	x -= 1
for i in answer[::-1]:
	print(i)


n = int(input())
saw = set()
for _ in range(n):
	a = input()
	if a in saw:
		print('YES')
	else:
		print('NO')
		saw.add(a)


n = int(input())
empty = []
for i in range(n):
	x = input()
	if x in empty:
		print('Yes')
	else:
		print('No')
	empty.append(x)


n = int(input())
arr = []
for i in range(n):
	name = input()
	if name not in arr:
		arr.append(name)
		print('NO')
	else:
		print('YES')


t = {}
for i in range(int(input())):
	name = input()
	if name in t:
		print('YES')
	else:
		t[name] = 1
		print('NO')


def max1(a):
	p = a[0]
	for x in a:
		if x > p:
			p = x
	return p

def prlist(a):
	for x in a:
		print(x, end=' ')
n = int(input())
a = []
for i in range(n):
	b = input()
	a.append(b)
for i in range(n):
	fl = False
	for j in range(i):
		if a[i] == a[j]:
			fl = True
	if fl:
		print('YES')
	else:
		print('NO')


import math
import re

def ria():
	return [int(i) for i in input().split()]
n = ria()[0]
mp = {}
for i in range(n):
	st = input()
	print('YES' if st in mp else 'NO')
	mp[st] = 1


n = int(input())
d = {}
for i in range(n):
	name = input()
	print(d.get(name, 'NO'))
	d[name] = 'YES'


a = int(input())
b = []
q = []
su = 0
for i in range(a):
	a = input()
	c = 0
	d = 0
	su = 0
	for j in range(len(b)):
		if len(b) == 0:
			print('NO')
		if b[j] == a:
			q.append(1)
			c += 1
		elif c == 0 and d == 0:
			q.append(0)
			d += 1
		for w in range(len(q)):
			su += q[w]
	if su >= 1:
		print('YES')
	else:
		print('NO')
	while len(q) != 0:
		q.pop(0)
	b.append(a)


st = set()
n = int(input())
for i in range(n):
	vards = input()
	if vards in st:
		print('YES')
	else:
		print('NO')
		st.add(vards)


a = (input() for i in range(0, int(input())))
b = []
for i in a:
	if b.count(i) == 0:
		print('NO')
	else:
		print('YES')
	b.append(i)


n = int(input())
prev = []
for i in range(n):
	curr = input()
	h = hash(curr)
	if h not in prev:
		print('NO')
		prev.append(h)
	else:
		print('YES')


def is_repeted(n):
	names = dict()
	for _ in range(0, n):
		name = input()
		if name in names:
			names[name] += 1
		else:
			names[name] = 0
		if names[name] == 0:
			print('No')
		else:
			print('YES')
n = int(input())
is_repeted(n)


a = int(input())
names = []
o = []
for i in range(a):
	b = input()
	if names.count(b) != 0:
		names.append(b)
		o.append('Yes')
	else:
		names.append(b)
		o.append('No')
for i in range(a):
	print(o[i])


A = set()
n = int(input())
for _ in range(n):
	name = input()
	if name in A:
		print('YES')
	else:
		print('NO')
		A.add(name)


n = int(input())
namesList = set()
for i in range(0, n):
	currentName = input()
	if currentName not in namesList:
		print('NO')
		namesList.add(currentName)
	elif currentName in namesList:
		print('YES')


n = int(input())
s = set()
answers = ('NO', 'YES')
for i in range(n):
	name = input()
	print(answers[name in s])
	s.add(name)


import sys

def main():
	n = int(input())
	names = set()
	for i in range(n):
		x = input()
		if x in names:
			print('YES')
		else:
			print('NO')
			names.add(x)
sys.exit(main())


n = int(input())
l = []
while n:
	s = input()
	if s not in l:
		print('NO')
	else:
		print('YES')
	l.append(s)
	n = n - 1


amount = int(input())
list_of_names = []
for i in range(amount):
	name = input()
	if name not in list_of_names:
		print('NO')
		list_of_names.append(name)
	else:
		print('YES')


n = int(input())
s = []
for i in range(n):
	a = input()
	ans = 'NO'
	for j in s:
		if j == a:
			ans = 'YES'
	print(ans)
	s.append(a)


num = int(input())
names = set()
for x in range(num):
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
		names.add(name)


import sys
names = sys.stdin.readlines()[1:]
for (n, name) in enumerate(names):
	if name in names[:n]:
		print('YES')
	else:
		print('NO')


def main():
	n = int(input())
	lst = list()
	for _ in range(n):
		line = input()
		if line not in lst:
			print('NO')
			lst.append(line)
		else:
			print('YES')
main()


n = int(input())
ar = list()
for i in range(n):
	x = str(input())
	ar.append(x)
	if ar.count(x) > 1:
		print('YES')
	else:
		print('NO')


(a, c) = ({}, [])
for i in range(int(input())):
	b = input()
	c.append(['NO', 'YES'][b in a])
	a[b] = True
print('\n'.join(c))


n = int(input())
lst = []
r = []
for i in range(n):
	x = str(input())
	r.append('YES' if x in lst else 'NO')
	lst.append(x)
for i in range(n):
	print(r[i])


x = int(input())
s = []
for i in range(x):
	a = input()
	s.append(a)
print('NO')
for i in range(1, x):
	c = 0
	for j in range(0, i):
		if s[i] == s[j]:
			c = 1
	if c == 1:
		print('YES')
	else:
		print('NO')


n = int(input())
ls = []
res = []
for i in range(n):
	char = input()
	if char in ls:
		res.append('YES')
	else:
		ls.append(char)
		res.append('No')
for i in range(len(res)):
	print(res[i])


L = []
for i in range(int(input())):
	x = input()
	if x in L:
		print('YES')
	else:
		print('NO')
	L.append(x)


d = int(input())
vis = dict()
for i in range(d):
	s = input().split()[0]
	if vis.get(s):
		print('YES')
	else:
		print('NO')
		vis[s] = 1


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
seen = set()
for _ in range(int(f_input())):
	name = f_input().replace('\n', '')
	if name in seen:
		f_print('YES\n')
	else:
		seen.add(name)
		f_print('NO\n')


n = int(input())
l = []
for i in range(n):
	l.append(input())
print('no')
for i in range(1, n):
	co = 0
	for j in range(i):
		if l[i] == l[j]:
			print('yes')
			co += 1
			break
	if co == 0:
		print('no')


num = int(input())
listy = []
new_list = []
finallist = []
counter1 = 0
for i in range(num):
	inn = input()
	listy.append(inn)

def myindex(mylist, element, index):
	for i in range(index, len(mylist)):
		if mylist[i] == element:
			return i
		else:
			return -1
for item in listy:
	counter2 = 0
	summ = 0
	for y in listy:
		num1 = myindex(listy, item, counter1)
		num2 = myindex(listy, y, counter2)
		if item == y and num1 > num2:
			summ += 1
		else:
			summ += 0
		counter2 += 1
	new_list.append(summ)
	counter1 += 1
for j in new_list:
	if j == 0:
		finallist.append('No')
	else:
		finallist.append('Yes')
for k in finallist:
	print(k)


query = int(input())
d = {}
for _ in range(query):
	name = input()
	if name not in d:
		d[name] = 1
		print('NO')
	else:
		print('YES')


names = int(input())
list_names = []
ans = ['NO']
for i in range(names):
	name = input()
	list_names.append(name)
for j in range(1, names):
	for k in range(j):
		if list_names[j] == list_names[k]:
			ans.append('YES')
			break
		elif list_names[j] != list_names[k] and j == k + 1:
			ans.append('NO')
print(*ans, sep='\n')


n = int(input())
x = set()
y = []
z = {1: 'YES', 0: 'NO'}
for i in range(n):
	i = input()
	if i in x:
		y.append(1)
	else:
		y.append(0)
		x.add(i)
for i in y:
	print(z.get(i))


d = {}
for _ in range(int(input())):
	s = input()
	if s in d:
		print('YES')
	else:
		print('NO')
		d[s] = 1


a = set()
b = 0
for i in range(int(input())):
	a.add(input())
	if b >= len(a):
		print('YES')
	else:
		print('NO')
	b = len(a)


n = int(input())
people = set()
for i in range(n):
	person = input()
	if person in people:
		print('YES')
	else:
		people.add(person)
		print('NO')


myList = []
for _ in range(int(input())):
	tmp = input()
	print('YES' if tmp in myList else 'NO')
	myList.append(tmp)


n = int(input())
l = set()
for _ in range(n):
	m = input()
	if m in l:
		print('YES')
	else:
		print('NO')
	l.add(m)


n = int(input())
a = set()
for i in range(n):
	t = input()
	sz = len(a)
	a.add(t)
	if sz == len(a):
		print('YES')
	else:
		print('NO')


T = int(input())
lst = []
for _ in range(T):
	s = input()
	lst.append(s)
for i in range(len(lst)):
	if lst[i] in lst[:i]:
		print('YES')
	else:
		print('NO')


number = int(input())
lst = []
for i in range(number):
	x = input()
	lst.append(x)
for i in range(number):
	for j in range(0, i):
		if lst[i] == lst[j]:
			print('Yes')
			break
	else:
		print('NO')


t = int(input())
listWord = []
for cast in range(t):
	n = input().strip()
	if n in listWord:
		print('YES')
	else:
		listWord.append(n)
		print('NO')


import sys

def main():
	n = int(input())
	names = list()
	for i in range(n):
		x = input()
		if x in names:
			print('YES')
		else:
			print('NO')
			names.append(x)
sys.exit(main())


n = int(input())
result = []
final = []
for i in range(0, n):
	inputme = input()
	if inputme in result:
		final.append('YES')
	else:
		final.append('NO')
	result.append(inputme)
for i in final:
	print(i)


diary = {}
n = int(input())
while n > 0:
	name = input()
	if name not in diary:
		print('NO')
		diary[name] = 1
	else:
		print('YES')
	n -= 1


t = int(input())
list = []
while t > 0:
	a = input()
	if a in list:
		print('YES')
	else:
		list.append(a)
		print('NO')
	t -= 1


a = int(input())
l = []
h = []
for x in range(a):
	t = input()
	if t in h:
		l.append('YES')
	else:
		l.append('NO')
	h.append(t)
for x in l:
	print(x)


def isPossessed(i, names):
	return 'YES' if names[i] in names[:i] else 'NO'
n = int(input().strip())
names = []
for i in range(n):
	names.append(input().strip())
for i in range(n):
	res = isPossessed(i, names)
	print(res)


n = int(input())
array = []
for i in range(n):
	array.append(input())
for i in range(n):
	for j in range(i + 1):
		if j == i:
			print('NO')
		elif array[i] == array[j]:
			print('YES')
			break


name_l = []
for _ in range(int(input())):
	n = input()
	if n not in name_l:
		print('NO')
		name_l.append(n)
	else:
		print('YES')


n = int(input())
m = []
for i in range(n):
	m.append(input())
ans = []
M = []
for i in range(len(m)):
	search = False
	for j in range(len(ans)):
		if ans[j] == m[i]:
			search = True
	if search == True:
		M.append('Yes')
	else:
		M.append('No')
		ans.append(m[i])
for i in range(len(M)):
	print(M[i])


n = int(input())
f = []
for i in range(n):
	x = input()
	f.append(x)
print('NO')
for i in range(1, n):
	a = f[0:i]
	if f[i] in a:
		print('YES')
	else:
		print('NO')


class CodeforcesTask855ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.diary = []

	def read_input(self):
		self.n = int(input())
		for _ in range(self.n):
			self.diary.append(input())

	def process_task(self):
		res = []
		visits = set()
		for entry in self.diary:
			if entry in visits:
				res.append('YES')
			else:
				res.append('NO')
				visits.add(entry)
		self.result = '\n'.join(res)

	def get_result(self):
		return self.result
Solution = CodeforcesTask855ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
S = []
for x in range(n):
	x = input()
	if x in S:
		print('YES')
	else:
		print('NO')
		S.append(x)


n = int(input())
d = {}
for _ in range(n):
	s = input()
	try:
		if d[s] > 0:
			print('YES')
	except KeyError:
		d[s] = 1
		print('NO')


names_num = int(input())
names = []
for inputs in range(names_num):
	name = input()
	if name in names:
		print('YES')
	else:
		print('NO')
		names.append(name)


n = int(input())
x = []
for counter in range(0, n):
	dh = input()
	x.append(dh)
	if dh in x[:counter]:
		print('YES')
	else:
		print('NO')


n = int(input())
a = []
for x in range(n):
	x = input()
	a.append(x)
lst = []
for x in a:
	if not x in lst:
		print('NO')
		lst.append(x)
	else:
		print('YES')


index = 0
runner = 0
liste = []
while True:
	cin = input()
	if index == 0:
		runner = int(cin)
	if index > 0:
		liste.append(cin)
	if index == runner and index != 0:
		break
	index += 1
liste1 = []
for element in liste:
	if element in liste1:
		print('YES')
	else:
		print('NO')
	liste1.append(element)


t = int(input())
l = []
for cases in range(t):
	st = str(input())
	if st in l:
		print('YES')
	else:
		print('NO')
		l.append(st)


n = int(input())
arr = []
for i in range(n):
	arr.append(input())
for i in range(n):
	for j in range(len(arr)):
		if arr[j] == arr[i] and i <= j:
			print('No')
			break
		elif arr[j] == arr[i] and j < i:
			print('Yes')
			break


def test_0():
	import math
	from collections import Counter
	n = list(map(int, input().split(' ')))[0]
	aa = set()
	for i in range(n):
		a = input().strip()
		if a in aa:
			print('YES')
		else:
			print('NO')
		aa.add(a)
test_0()


dict = {}
a = int(input())
for i in range(a):
	st = input()
	if st not in dict:
		dict[st] = 0
		print('No')
	else:
		print('Yes')


x = int(input())
sm = []
for i in range(x):
	sm.append(input())
print('NO')
for i in range(1, x):
	c = 0
	for l in range(i):
		if sm[i] == sm[l]:
			c += 1
	if c > 0:
		print('YES')
	else:
		print('NO')


t = int(input())
a = []
b = []
for i in range(t):
	n = input()
	if n in a:
		b.append('YES')
	else:
		b.append('NO')
		a.append(n)
for i in b:
	print(i)


def main():
	n = int(input())
	s = set()
	for _ in range(n):
		w = input()
		if w in s:
			print('YES')
		else:
			print('NO')
		s.add(w)
main()


n = int(input())
f = []
for i in range(n):
	m = input()
	f.append(m)
for i in range(n):
	g = 'NO'
	for j in range(i):
		if f[i] == f[j]:
			g = 'YES'
	print(g)


n = int(input())
names = [input() for _ in range(n)]
history = set()
for e in names:
	if e not in history:
		history.add(e)
		print('NO')
	else:
		print('YES')


n = int(input())
sp = []
for i in range(n):
	s = input()
	if s in sp:
		print('YES')
	elif s not in sp:
		print('NO')
		sp.append(s)


y = int(input())
lz = []
j = 0
flag = True
for i in range(y):
	z = str(input())
	lz.append(z)
	for j in range(i + 1):
		if lz[j] == lz[i]:
			flag = False
			break
	if j == i:
		print('NO')
	elif not flag:
		print('YES')
	else:
		print('NO')


has_owned = []
for i in range(int(input())):
	s = input()
	if s in has_owned:
		print('YES')
	else:
		print('NO')
		has_owned.append(s)


n = int(input())
kek = set()
lol = list(kek)
for i in range(n):
	a = input()
	if a in lol:
		print('YES')
	else:
		print('NO')
		lol.append(a)


n = int(input())
D = {}
while n != 0:
	n -= 1
	s = input()
	if s in D:
		print('YES')
	else:
		print('NO')
	D[s] = 1


n = int(input())
(s, t) = ([], [])
for i in range(n):
	a = input()
	s += [a]
for i in range(len(s)):
	if s[i] not in t:
		t += [s[i]]
		print('NO')
	else:
		print('YES')


def found(arr, s):
	m = True
	for i in range(len(arr)):
		if arr[i] == s:
			m = False
			print('YES')
			break
	if m:
		print('NO')
arr = []
t = int(input())
while t:
	s = input()
	found(arr, s)
	arr.append(s)
	t = t - 1


st = set()
for k in range(int(input())):
	vards = input()
	if vards in st:
		print('YES')
	else:
		st.add(vards)
		print('NO')


a = []
for _ in range(int(input())):
	x = input()
	if x not in a:
		print('NO')
		a += [x]
	else:
		print('YES')


lt = [input() for i in range(int(input()))]
st = set()
for i in lt:
	print('YES') if i in st else print('NO')
	st.add(i)


x = int(input())
arr = []
while x > 0:
	s = input()
	if s in arr:
		print('YES')
	else:
		arr.append(s)
		print('NO')
	x -= 1


import time

def identifyDuplicates(namesList):
	uniques = []
	for name in namesList:
		if name not in uniques:
			uniques.append(name)
			print('NO')
		else:
			print('YES')

def solve():
	names = int(input())
	namesList = []
	for x in range(names):
		namesList.append(input())
	identifyDuplicates(namesList)
solve()


num = int(input())
present = []
for i in range(num):
	current = input()
	if current not in present:
		print('NO')
		present.append(current)
	else:
		print('YES')


p = input()
test = []
for i in range(int(p)):
	t = str(input())
	if str(t) in test:
		print('YES')
	else:
		print('NO')
	test.append(t)


n = int(input())
u = []
for _ in range(n):
	inp = input()
	if inp in u:
		print('YES')
	else:
		u.append(inp)
		print('NO')


a = int(input())
b = set()
for x in range(a):
	g = input()
	cucc = True if g in b != -1 else False
	print('NO') if not cucc else print('YES')
	b.add(g)


n = int(input())
a = []
b = [True] * n
for i in range(n):
	a.append((input(), i))
a.sort()
for i in range(n - 1):
	while i < n - 1 and a[i][0] == a[i + 1][0]:
		b[a[i + 1][1]] = False
		i += 1
for i in b:
	if i:
		print('NO')
	else:
		print('YES')


n = int(input())
s = set()
for _ in range(n):
	name = input()
	print(name in s and 'YES' or 'NO')
	s.add(name)


n = int(input())
L = []
for i in range(n):
	N = input()
	print('YES' if N in L else 'NO')
	L.append(N)


l = []
z = []
for i in range(int(input())):
	l.append(input())
for k in l:
	if k not in z:
		print('NO')
		z.append(k)
	else:
		print('YES')


n = int(input())
a = str(input())
i = 1
mas = [a]
print('NO')
while i < n:
	a = str(input())
	mas.append(a)
	j = 0
	while j <= i:
		if j == i:
			print('NO')
			break
		if mas[j] == mas[i]:
			print('YES')
			break
		j += 1
	i += 1


n = int(input())
a = []
b = []
t = 0
for i in range(n):
	e = str(input())
	a.append(e)
b = a
for i in range(n):
	for j in range(i):
		if a[i] == b[j]:
			t = 1
	if t == 1:
		print('YES')
	else:
		print('NO')
	t = 0


def hadbefore(names):
	had = [names[0]]
	output = ['NO']
	del names[0]
	for i in names:
		if i not in had:
			had.append(i)
			output.append('NO')
		else:
			output.append('YES')
	return output
while True:
	try:
		amount = input()
		names = []
		for i in range(int(amount)):
			names.append(input())
		o = hadbefore(names)
		for name in o:
			print(name)
	except EOFError:
		break


x = int(input())
z = []
s = []
for n in range(x):
	z.append(input())
for n in range(x):
	if z[x - 1 - n] in z[:x - n - 1]:
		s.append('YES')
	else:
		s.append('NO')
for n in s[::-1]:
	print(n)


a = int(input())
b = []
c = set()
cnt = 0
for i in range(a):
	b = input()
	if b in c:
		print('YES')
	else:
		print('NO')
	c.add(b)


tests = int(input())
list = []
for number in range(tests):
	a = str(input())
	list.append(a)
for temp in range(tests):
	flag = 0
	for temp1 in range(temp):
		if list[temp] == list[temp1]:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


import sys
import math
import bisect

def main():
	s = set()
	for _ in range(int(input())):
		a = input()
		if a in s:
			print('YES')
		else:
			print('NO')
		s.add(a)
main()


n = int(input())
lst = []
for i in range(n):
	s = input()
	flag = False
	for i in range(len(lst)):
		if s == lst[i]:
			flag = True
	if flag == True:
		print('YES')
	else:
		print('NO')
	lst.append(s)


n = int(input())
s = []
d = set()
e = []
for i in range(n):
	s.append(input())
for i in range(n):
	if s[i] in d:
		e.append('YES')
	else:
		e.append('NO')
		d.add(s[i])
for i in e:
	print(i)


import sys
n = int(sys.stdin.readline().strip())
s_set = set()
for i in range(n):
	s = sys.stdin.readline().strip()
	print('YES' if s in s_set else 'NO')
	s_set.add(s)


n = int(input())
a = []
for i in range(n):
	a.append(str(input()))
print('NO')
for i in range(1, n):
	st = 0
	for j in range(i):
		if a[j] == a[i]:
			print('YES')
			st = 1
			break
	if st == 0:
		print('NO')


n = int(input())
S = []
for i in range(n):
	m = input()
	if m in S:
		print('yes')
	else:
		S += [m]
		print('no')


n = int(input())
s = set([input()])
print('NO')
for _ in range(n - 1):
	a = input()
	if a not in s:
		print('NO')
		s.add(a)
	else:
		print('YES')


count = int(input())
loop = 0
names = []
for counting in range(0, count):
	name = input()
	names.append(name)
for each in names:
	if each in names[0:loop]:
		print('YES')
	else:
		print('NO')
	loop += 1


n = int(input())
s = []
for _ in range(n):
	x = input()
	if x in s:
		print('Yes')
	else:
		print('No')
		s.append(x)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l1 = [S() for _ in range(n)]
	l2 = []
	ans = []
	for x in l1:
		if l2.count(x) > 0:
			ans.append('YES')
		else:
			ans.append('NO')
		l2.append(x)
	for x in ans:
		print(x)
main()


num = int(input())
aux = ''
nombres = []
for i in range(num):
	aux = input()
	if aux in nombres:
		print('YES')
	else:
		print('NO')
	nombres.append(aux)


n = int(input())
a = []
while n:
	n = n - 1
	s = input()
	if a and s in a:
		print('YES')
	else:
		print('NO')
		a.append(s)


n = int(input())
arr = []
for i in range(n):
	z = input()
	if z in arr:
		print('YES')
	else:
		print('NO')
		arr.append(z)


n = int(input())
a = []
for i in range(n):
	x = input()
	done = True
	for j in range(len(a)):
		if x == a[j]:
			print('YES')
			done = False
			break
	if done:
		a += [x]
		print('NO')


myDict = {}

class Solution:

	def solve(self, string):
		if string not in myDict:
			myDict[string] = 1
			return False
		else:
			return True
sol = Solution()
t = int(input().strip())
for i in range(t):
	string = input().strip()
	print('YES' if sol.solve(string) else 'NO')


n = int(input())
a = []
ans = []
for x in range(n):
	temp = input()
	if temp in a:
		ans.append('YES')
	else:
		ans.append('NO')
	a.append(temp)
print(*ans, sep='\n')


queries_count = int(input())
s = []
while queries_count > 0:
	name = input()
	queries_count -= 1
	a = 0
	for elem in s:
		if elem == name:
			print('YES')
			a = 1
			break
	if a != 1:
		print('NO')
		s.append(name)


n = int(input())
d = {}
for u in range(n):
	l = input()
	if l in d:
		print('YES')
	else:
		print('NO')
		d[l] = 1


note = set()
for _ in range(int(input())):
	s = input()
	if s in note:
		print('YES')
	else:
		print('NO')
	note.add(s)


n = int(input())
s = [input() for _ in range(n)]
name = set([])
for si in s:
	if si in name:
		print('YES')
	else:
		print('NO')
		name.add(si)


n = int(input())
a = set()
s = input()
a.add(s)
print('NO')
while n - 1:
	s = input()
	if s in a:
		print('YES')
	else:
		a.add(s)
		print('NO')
	n -= 1


n = int(input())
d = set()
while n > 0:
	s = input()
	if s in d:
		print('YES')
	else:
		d.add(s)
		print('NO')
	n -= 1


from sys import stdin, stdout
n = int(stdin.readline())
challengers = set()
for i in range(n):
	s = stdin.readline().strip()
	if s in challengers:
		stdout.write('YES\n')
	else:
		stdout.write('NO\n')
	challengers.add(s)


n = int(input())
l = list()
s = list()
i = 0
while i < n:
	l.append(input())
	i += 1
while i > 0:
	p = l.pop()
	k = l.count(p)
	if k == 0:
		s.append('NO')
	else:
		s.append('YES')
	i -= 1
s.reverse()
for i in s:
	print(i)


a = int(input())
(b, c) = ([], [])
for x in range(a):
	b.append(input())
if len(set(b)) != a:
	for x in range(a):
		if b[x] not in c:
			print('NO')
		else:
			print('YES')
		c.append(b[x])
else:
	for x in range(a):
		print('NO')


n = int(input())
names = []
while n:
	n = n - 1
	s = input()
	if names.count(s):
		print('YES')
	else:
		names.append(s)
		print('NO')


num = int(input())
temp = []
yesno = []
for i in range(num):
	a = input()
	if a not in temp:
		temp.append(a)
		yesno.append('NO')
	else:
		yesno.append('YES')
for i in yesno:
	print(i)


import itertools
import math
from collections import defaultdict

def input_ints():
	return list(map(int, input().split()))

def solve():
	n = int(input())
	st = set()
	for i in range(n):
		s = input()
		print('YES' if s in st else 'NO')
		st.add(s)
solve()


n = int(input())
l = [input() for i in range(n)]
lst = []
s = {}
for i in l:
	if i not in s:
		print('NO')
	else:
		print('YES')
	lst.append(i)
	s = set(lst)


n = int(input())
names = [input() for _ in range(n)]
for i in range(n):
	flag = True
	for j in range(n):
		if names[i] == names[j] and j < i:
			print('YES')
			flag = False
			break
	if flag:
		print('NO')
		flag = True


n = int(input())
c = []
o = []
for i in range(n):
	s = input()
	if s in c:
		o.append('YES')
	else:
		o.append('NO')
	c.append(s)
for i in range(n):
	print(o[i])


n = int(input())
names = {}
for _ in range(n):
	z = input()
	if z not in names.keys():
		names[z] = 1
		print('NO')
	else:
		names[z] += 1
		print('YES')


n = int(input())
ndict = []
for i in range(0, n, 1):
	s = input()
	if s in ndict:
		print('YES')
	else:
		print('NO')
		ndict.append(s)


n = int(input())
arr = []
arr1 = []
q = 0
for x in range(n):
	arr.append(input())
for i in range(len(arr)):
	if i != 0:
		for j in range(len(arr[:i])):
			if arr[i] == arr[j]:
				q = 1
	if i == 0:
		arr1.append('NO')
	elif q == 1:
		q = 0
		arr1.append('YES')
	else:
		arr1.append('NO')
for y in range(len(arr1)):
	print(*arr1[y], sep='')


n = int(input())
names = []
result = []
for i in range(n):
	name = input()
	isFound = False
	for i in names:
		if name == i:
			isFound = True
	if isFound == True:
		result.append('YES')
		names.append(name)
	else:
		result.append('NO')
		names.append(name)
for i in result:
	print(i)


n = int(input())
l = []
for i in range(n):
	a = input()
	l.append(a)
	if l.count(l[i]) > 1:
		print('Yes')
	else:
		print('No')


1
s = []
for _ in range(int(input())):
	s2 = input()
	if s2 in s:
		print('YES')
	else:
		print('NO')
		s.append(s2)


t = int(input())
s = set()
while t:
	t -= 1
	temp = input().strip()
	if temp in s:
		print('YES')
	else:
		print('NO')
	s.add(temp)


li = []
for i in range(int(input())):
	a = input()
	if a in li:
		print('YES')
		li.append(a)
	else:
		print('NO')
		li.append(a)


n = int(input())
sett = set([])
for i in range(0, n):
	s = input()
	if s not in sett:
		print('NO')
		sett.add(s)
	else:
		print('YES')


n = int(input())
array = []
print('NO')
for i in range(n):
	s = input()
	for j in range(len(array)):
		if s == array[j]:
			print('YES')
			break
		if j == len(array) - 1 and s != array[j]:
			print('NO')
		if s != array[j]:
			continue
	array += [s]


import sys
pin = sys.stdin.readline
pout = sys.stdout.write
ran = range
t = int(pin())
total = []
for i in ran(t):
	string = pin()
	if string in total:
		print('YES')
	else:
		print('NO')
	total.append(string)


n = int(input())
s = set()
for i in range(n):
	x = input()
	print({True: 'YES', False: 'NO'}[x in s])
	s.add(x)


no_of_names = int(input())
names = []
for i in range(no_of_names):
	name = input()
	if name not in names:
		names.append(name)
		print('NO')
	else:
		print('YES')


n = int(input())
M = []
D = []
for i in range(n):
	s = input()
	M.append(s)
	if M.index(s) == i:
		D.append('NO')
	else:
		D.append('YES')
for k in D:
	print(k)


u = []
n = int(input())
for i in range(0, n):
	s = input()
	if u.count(s).bit_length() > 0:
		print('yes')
	else:
		print('no')
		u.append(s)


n = int(input())
l = []
for i in range(n):
	l.append(input())
w = []
for i in range(len(l)):
	if l[i] not in w:
		w.append(l[i])
		print('No')
	else:
		print('Yes')


visited = []
n = int(input())
for i in range(n):
	curr = input()
	if curr in visited:
		print('YES')
	else:
		visited.append(curr)
		print('NO')


n = int(input())
x = list()
for i in range(n):
	temp = input()
	if temp in x:
		print('YES')
		x.append(temp)
	else:
		print('NO')
		x.append(temp)


n = int(input())
names = {}
for i in range(0, n):
	name = input()
	if any((x == name for x in names)) == False:
		print('NO')
		names[name] = 1
	else:
		print('YES')


numer = int(input())
newWords = list()
for i in range(numer):
	inn = input()
	if not inn in newWords:
		newWords.append(inn)
		print('NO')
	else:
		print('YES')


n = int(input())
L = []
for i in range(n):
	tmp = input()
	if tmp not in L:
		print('NO')
	else:
		print('YES')
	L.append(tmp)


a = input()
a = int(a)
ins = set()
l = []
dizio = {}
for x in range(a):
	k = input()
	ins.add(k)
	l.append(k)
for x in ins:
	dizio[x] = 0
for x in l:
	if dizio[x] == 0:
		print('NO')
		dizio[x] += 1
	elif dizio[x] > 0:
		print('YES')


n = int(input())
lst = []
for _ in range(n):
	lst.append(input())
chamber = []
for i in lst:
	if i in chamber:
		print('YES')
	else:
		print('NO')
	chamber.append(i)


first = []
number = int(input())
for i in range(number):
	first.append(input())
visible = [False for i in range(number)]
for i in range(number):
	for j in range(number):
		if i != j and first[i] == first[j] and (i < j):
			visible[j] = True
for i in visible:
	if not i:
		print('NO')
	else:
		print('YES')


n = int(input())
answer = []
total = []
for i in range(0, n):
	s = input()
	if s in total:
		answer.append('YES')
	else:
		answer.append('NO')
	total.append(s)
for x in answer:
	print(x)


import sys, math
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
n = int(input())
s = set([])
for i in range(n):
	g = len(s)
	s.add(input())
	if len(s) > g:
		print('NO')
	else:
		print('YES')


n = int(input())
s = []
for i in range(n):
	s.append(input())
if n > 0:
	print('NO')
	for i in range(1, n):
		name = list(s[i])
		alert = 0
		for j in range(i):
			if name == list(s[j]):
				alert = 1
				print('YES')
				break
		if alert == 0:
			print('NO')


n = int(input())
names = dict()
for _ in range(n):
	name = input()
	if names.get(name) is None:
		names[name] = True
		print('NO')
	else:
		print('YES')


number = int(input())
nameslist = []
repeatname = []
for x in range(number):
	names = input().split()
	nameslist.append(names)
for x in nameslist:
	if x not in repeatname:
		repeatname.append(x)
		print('NO')
	else:
		print('YES')


q = int(input())
name_list = set()
for _ in range(q):
	name = input()
	if name in name_list:
		print('YES')
	else:
		print('NO')
	name_list.add(name)


n = int(input())
l = []
for i in range(n):
	si = str(input())
	l.append(si)
for i in range(0, n):
	if l[i] in l[0:i]:
		print('yes')
	else:
		print('no')


n = int(input())
humans = []
for i in range(n):
	human = input()
	humans.append(human)
answers = []
humans.reverse()
while len(answers) != n:
	this_human = humans[0]
	humans.pop(0)
	if this_human in humans:
		answers.append('YES')
	else:
		answers.append('NO')
answers.reverse()
print('\n'.join(answers))


n = int(input())
ok = False
s = [input() for _ in range(n)]
for i in range(n):
	for j in range(i):
		ok = False
		if not ok and s[i] == s[j]:
			ok = True
			print('YES')
			break
	if not ok:
		print('NO')


n = int(input())
d = {}
li = []
for i in range(n):
	s = input()
	if s not in li:
		print('No')
		li.append(s)
	elif s in li:
		print('Yes')


n = int(input())
names = []
already = []
for i in range(n):
	name = input()
	names.append(name)
for i in range(n):
	if names[i] not in already:
		already.append(names[i])
		print('NO')
	else:
		print('YES')


ls = []
for i in range(int(input())):
	s = input()
	ls.append(s)
	print(['YES', 'NO'][ls.count(s) == 1])


k = int(input())
a = list()
for i in range(k):
	p = input()
	a.append(p)
	c = 0
	for i in a:
		if i == p:
			c += 1
	if c > 1:
		print('YES')
	else:
		print('NO')


l = []
for _ in range(int(input())):
	s = input()
	if s not in l:
		print('NO')
		l.append(s)
	else:
		print('YES')


n = int(input())
d = {}
for i in range(n):
	s = input()
	try:
		if d[s] != 0:
			d[s] += 1
			print('YES')
	except:
		d[s] = 1
		print('NO')


def main():
	n = int(input())
	names = [input() for _ in range(n)]
	indexes = ['NO' for _ in range(n)]
	for i in range(n - 1):
		for j in range(i + 1, n):
			if names[i] == names[j]:
				indexes[j] = 'YES'
	print('\n'.join(indexes))
main()


N = int(input())
namelist = []
for i in range(0, N):
	S = input()
	if S in namelist:
		print('YES')
	else:
		print('NO')
		namelist.append(S)


def dfs(i, i0, ii):
	global a, b, c
	if i0:
		b.add(i)
	else:
		c.add(i)
	for i1 in a[i]:
		if i1 != ii:
			dfs(i1, not i0, i)
import sys
from collections import Counter
sys.setrecursionlimit(10 ** 6)
n = int(input())
a = set()
for i in range(n):
	v = input()
	if v in a:
		print('YES')
	else:
		print('NO')
	a.add(v)


s = set()
res = []
for i in range(int(input())):
	n = input()
	res.append('YES' if n in s else 'NO')
	s.add(n)
print('\n'.join(res))


n = int(input())
arr = []
for _ in range(n):
	s = input()
	if s not in arr:
		arr.append(s)
		print('NO')
	else:
		print('YES')


n = int(input())
d = dict()
for i in range(n):
	s = input()
	pos = False
	keeper = [0] * 26
	if s in d:
		print('YES')
	else:
		d[s] = 1
		print('NO')


(n,) = map(int, input().split())
ar = ['' for g in range(n)]
for k in range(n):
	ar[k] = input()
	t = 'NO'
	for x in range(k):
		if ar[x] == ar[k]:
			t = 'YES'
	print(t)


n = int(input())
s = []
for x in range(n):
	a = input()
	if a in s:
		print('YES')
	else:
		print('NO')
		s.append(a)


names_nr = int(input())
names_set = set()
for _ in range(names_nr):
	name = input()
	if name in names_set:
		print('YES')
	else:
		print('NO')
		names_set.add(name)


st = set()
n = int(input())
for i in range(n):
	w = input()
	e = len(st)
	st.add(w)
	if len(st) != e:
		print('NO')
	else:
		print('YES')


def diary_tom_reddle():
	n = int(input())
	names = list()
	for i in range(n):
		name = input()
		if name in names:
			print('YES')
		else:
			print('NO')
		names.append(name[:])
diary_tom_reddle()


a = int(input())
q = []
p = []
for i in range(0, a):
	s = str(input())
	if s in q:
		p.append('y')
	else:
		p.append('n')
		q.append(s)
for u in range(0, a):
	if p[u] == 'y':
		print('YES')
	else:
		print('NO')


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
(n,) = q()
a = []
for _ in range(n):
	i = input()
	a.append(i)
	print('YES' if a.count(i) > 1 else 'NO')


n = int(input())
dic = dict()
for i in range(n):
	string = input()
	if string in dic:
		print('YES')
	else:
		print('NO')
		dic[string] = None


from math import ceil

def main():
	n = int(input())
	names = [input() for v in range(n)]
	added = set()
	for n in names:
		if n in added:
			print('YES')
		else:
			print('NO')
		added.add(n)
main()


n = int(input())
A = []
for i in range(n):
	temp = str(input())
	if temp not in A:
		print('NO')
		A.append(temp)
	else:
		print('YES')


a = []
for i in range(int(input())):
	s = input()
	for j in a:
		if j == s:
			print('YES')
			break
	else:
		a.append(s)
		print('NO')