N = int(eval(input()))

D = list(map(int, input().split()))

M = int(eval(input()))

T = list(map(int, input().split()))



dicD = {}

dicT = {}



for d in D:

    if d not in dicD:

        dicD[d] = 0

    dicD[d] += 1



for t in T:

    if t not in dicT:

        dicT[t] = 0

    dicT[t] += 1



for t in dicT:

    if t not in dicD:

        print("NO")

        break

    elif dicT[t] > dicD[t]:

        print("NO")

        break

else:

    print("YES")
N = int(eval(input()))

D = list(map(int, input().split()))

M = int(eval(input()))

T = list(map(int, input().split()))



dicD = {}

dicT = {}



for d in D:

    if d not in dicD:

        dicD[d] = 0

    dicD[d] += 1



for t in T:

    if t not in dicT:

        dicT[t] = 0

    dicT[t] += 1



for t in dicT:

    if (t not in dicD) or (dicT[t] > dicD[t]):

        print("NO")

        break

else:

    print("YES")
N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
dicD = {}
dicT = {}
for d in D:
    if d not in dicD:
        dicD[d] = 0
    dicD[d] += 1
for t in T:
    if t not in dicT:
        dicT[t] = 0
    dicT[t] += 1
for t in dicT:
    if t not in dicD:
        print("NO")
        break
    elif dicT[t] > dicD[t]:
        print("NO")
        break
else:
    print("YES")

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
dicD = {}
dicT = {}
for d in D:
    if d not in dicD:
        dicD[d] = 0
    dicD[d] += 1
for t in T:
    if t not in dicT:
        dicT[t] = 0
    dicT[t] += 1
for t in dicT:
    if (t not in dicD) or (dicT[t] > dicD[t]):
        print("NO")
        break
else:
    print("YES")

-    if t not in dicD: -        print("NO") -        break -    elif dicT[t] > dicD[t]: +    if (t not in dicD) or (dicT[t] > dicD[t]):