from collections import Counter



N = int(eval(input()))

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

M = int(eval(input()))

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



d = Counter(D)

t = Counter(T)

for key, value in list(t.items()):

    if d.get(key, 0) < value:

        print('NO')

        exit()

else:

    print('YES')
from collections import Counter





def main():

    N = int(eval(input()))

    D = input().split()

    M = int(eval(input()))

    T = input().split()



    d = Counter(D)

    t = Counter(T)

    for key, value in list(t.items()):

        if d.get(key, 0) < value:

            print('NO')

            exit()

    else:

        print('YES')





if __name__ == '__main__':

    main()
from collections import Counter

N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))
d = Counter(D)
t = Counter(T)
for key, value in list(t.items()):
    if d.get(key, 0) < value:
        print("NO")
        exit()
else:
    print("YES")

from collections import Counter


def main():
    N = int(eval(input()))
    D = input().split()
    M = int(eval(input()))
    T = input().split()
    d = Counter(D)
    t = Counter(T)
    for key, value in list(t.items()):
        if d.get(key, 0) < value:
            print("NO")
            exit()
    else:
        print("YES")


if __name__ == "__main__":
    main()

-N = int(eval(input())) -D = list(map(int, input().split())) -M = int(eval(input())) -T = list(map(int, input().split())) -d = Counter(D) -t = Counter(T) -for key, value in list(t.items()): -    if d.get(key, 0) < value: -        print("NO") -        exit() -else: -    print("YES") + +def main(): +    N = int(eval(input())) +    D = input().split() +    M = int(eval(input())) +    T = input().split() +    d = Counter(D) +    t = Counter(T) +    for key, value in list(t.items()): +        if d.get(key, 0) < value: +            print("NO") +            exit() +    else: +        print("YES") + + +if __name__ == "__main__": +    main()