n,a=open(0);print(('YNEOS'[int(n)>len(set(a.split()))::2]))
print(('YNEOS'[int(eval(input()))>len(set(input().split()))::2]))
n, a = open(0)
print(("YNEOS"[int(n) > len(set(a.split())) :: 2]))

print(("YNEOS"[int(eval(input())) > len(set(input().split())) :: 2]))

-n, a = open(0) -print(("YNEOS"[int(n) > len(set(a.split())) :: 2])) +print(("YNEOS"[int(eval(input())) > len(set(input().split())) :: 2]))