firstLine=input()
n=int(firstLine)
nameList=[]
for i in range(n):
    name=input()
    if name in nameList:
        print("YES")
    else:
        print("NO")
        nameList.append(name)
db4babc24414b8b98bac832ccf13ab13430fdac2
<mask token>

<mask token>
for i in range(n):
    name = input()
    if name in nameList:
        print('YES')
    else:
        print('NO')
        nameList.append(name)

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

firstLine=input()
n=int(firstLine)
nameList=[]
for i in range(n):
    name=input()
    if name in nameList:
        print("YES")
    else:
        print("NO")
        nameList.append(name)