m, n = map(int, input().split())
L = list(map(int,input().split()))
l = list(map(int,input().split()))
for i in l:
if i in L:
boo = True
else:
boo = False
break
if boo == True:
print("Yes")
else:
print("No")