n = int(eval(input()))

d = input().split()

b1 = dict()

for i in d:

    b1[i] = b1.get(i, 0) + 1##b1[難易度]=手持ちの問題案で, 該当する難易度の問題数



m = int(eval(input()))

t = input().split()

b2 = dict()

for i in t:

    b2[i] = b2.get(i, 0) + 1##b2[難易度]=予選に使う問題セットで, 該当する難易度の問題数



for tKey in list(b2.keys()):

    if not(tKey in b1) or (b2[tKey] > b1[tKey]):

        print('NO')

        exit()       

print('YES')        
def main():

    from collections import defaultdict



    N = int(eval(input()))

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

    M = int(eval(input()))

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



    d = defaultdict(int)

    for D_ in D:

        d[D_] += 1



    for T_ in T:

        d[T_] -= 1

        if d[T_] < 0:

            return 'NO'



    return 'YES'





if __name__ == '__main__':

    print((main()))

n = int(eval(input()))
d = input().split()
b1 = dict()
for i in d:
    b1[i] = b1.get(i, 0) + 1  ##b1[難易度]=手持ちの問題案で, 該当する難易度の問題数
m = int(eval(input()))
t = input().split()
b2 = dict()
for i in t:
    b2[i] = b2.get(i, 0) + 1  ##b2[難易度]=予選に使う問題セットで, 該当する難易度の問題数
for tKey in list(b2.keys()):
    if not (tKey in b1) or (b2[tKey] > b1[tKey]):
        print("NO")
        exit()
print("YES")

def main():
    from collections import defaultdict

    N = int(eval(input()))
    D = tuple(map(int, input().split()))
    M = int(eval(input()))
    T = tuple(map(int, input().split()))
    d = defaultdict(int)
    for D_ in D:
        d[D_] += 1
    for T_ in T:
        d[T_] -= 1
        if d[T_] < 0:
            return "NO"
    return "YES"


if __name__ == "__main__":
    print((main()))

-n = int(eval(input())) -d = input().split() -b1 = dict() -for i in d: -    b1[i] = b1.get(i, 0) + 1  ##b1[難易度]=手持ちの問題案で, 該当する難易度の問題数 -m = int(eval(input())) -t = input().split() -b2 = dict() -for i in t: -    b2[i] = b2.get(i, 0) + 1  ##b2[難易度]=予選に使う問題セットで, 該当する難易度の問題数 -for tKey in list(b2.keys()): -    if not (tKey in b1) or (b2[tKey] > b1[tKey]): -        print("NO") -        exit() -print("YES") +def main(): +    from collections import defaultdict + +    N = int(eval(input())) +    D = tuple(map(int, input().split())) +    M = int(eval(input())) +    T = tuple(map(int, input().split())) +    d = defaultdict(int) +    for D_ in D: +        d[D_] += 1 +    for T_ in T: +        d[T_] -= 1 +        if d[T_] < 0: +            return "NO" +    return "YES" + + +if __name__ == "__main__": +    print((main()))