n, m = map(int, input().split())

L = list(map(int, input().split()))
l = list(map(int, input().split()))

b = True
for i in l:
    if i in L:
        pass
    else:
        b = False

if b == True:
    print("Yes")
else:
    print("No")