# Input : 5 4
# 1 0 3 2 4
# 1 2 3 0
# Output :
# YES
p,q=map(int,input().split())
l=list(map(int,input().split()))
m=list(map(int,input().split()))
c=0
if q<p:
    for i in m:
        if i in l:
            c+=1
    if c==q:
        print("YES")
    else:
        print("NO")
else:
    print("NO")        
24776f6f18449b3829df8ac7a6e4c76b878d1f5f
<mask token>

<mask token>
if q < p:
    for i in m:
        if i in l:
            c += 1
    if c == q:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

p, q = map(int, input().split())
l = list(map(int, input().split()))
m = list(map(int, input().split()))
c = 0
if q < p:
    for i in m:
        if i in l:
            c += 1
    if c == q:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

# Input : 5 4
# 1 0 3 2 4
# 1 2 3 0
# Output :
# YES
p,q=map(int,input().split())
l=list(map(int,input().split()))
m=list(map(int,input().split()))
c=0
if q<p:
    for i in m:
        if i in l:
            c+=1
    if c==q:
        print("YES")
    else:
        print("NO")
else:
    print("NO")        