N = int(eval(input()))

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

M = int(eval(input()))

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





D.sort()

T.sort()



flag = True

if N < M:

    flag = False

else:

    d_ind = 0

    find = False

    for i in range(M):

        for j in range(d_ind, N):

            if T[i] == D[j]:

                find = True

                d_ind = j+1

                break

        if not find:

            flag = False

            break

        find = False



if flag:

    print('YES')

else:

    print('NO')
N = int(eval(input()))

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

M = int(eval(input()))

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



D.sort()

T.sort()



flag = True

if N < M:

    flag = False

else:

    i = 0

    for ti in T:

        find = False

        while i < N:

            if ti == D[i]:

                find = True

                i += 1

                break

            else:

                i += 1

        if not find:

            flag = False



if flag:

    print('YES')

else:

    print('NO')
N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
D.sort()
T.sort()
flag = True
if N < M:
    flag = False
else:
    d_ind = 0
    find = False
    for i in range(M):
        for j in range(d_ind, N):
            if T[i] == D[j]:
                find = True
                d_ind = j + 1
                break
        if not find:
            flag = False
            break
        find = False
if flag:
    print("YES")
else:
    print("NO")

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
D.sort()
T.sort()
flag = True
if N < M:
    flag = False
else:
    i = 0
    for ti in T:
        find = False
        while i < N:
            if ti == D[i]:
                find = True
                i += 1
                break
            else:
                i += 1
        if not find:
            flag = False
if flag:
    print("YES")
else:
    print("NO")

-    d_ind = 0 -    find = False -    for i in range(M): -        for j in range(d_ind, N): -            if T[i] == D[j]: +    i = 0 +    for ti in T: +        find = False +        while i < N: +            if ti == D[i]: -                d_ind = j + 1 +                i += 1 +            else: +                i += 1 -            break -        find = False