Problem:
 Score : 200 points    Problem Statement Rng is preparing a problem set for a qualification round of CODEFESTIVAL.  He has N candidates of problems. The difficulty of the i -th candidate is D_i .  There must be M problems in the problem set, and the difficulty of the i -th problem must be T_i . Here, one candidate of a problem cannot be used as multiple problems.  Determine whether Rng can complete the problem set without creating new candidates of problems.      Constraints  1 \leq N \leq 200,000  1 \leq D_i \leq 10^9  1 \leq M \leq 200,000  1 \leq T_i \leq 10^9  All numbers in the input are integers.       Partial Score  100 points will be awarded for passing the test set satisfying N \leq 100 and M \leq 100 .         Input Input is given from Standard Input in the following format:  N  D_1  D_2  ...  D_N  M  T_1  T_2  ...  T_M       Output Print YES if Rng can complete the problem set without creating new candidates of problems; print NO if he cannot.        Sample Input 1 5
3 1 4 1 5
3
5 4 3      Sample Output 1 YES       Sample Input 2 7
100 200 500 700 1200 1600 2000
6
100 200 500 700 1600 1600      Sample Output 2 NO  Not enough 1600 s.       Sample Input 3 1
800
5
100 100 100 100 100      Sample Output 3 NO       Sample Input 4 15
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
9
5 4 3 2 1 2 3 4 5      Sample Output 4 YES

Solution (Python):
n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))

ans = "YES"
cntd = {}
for di in d:
    if di in cntd:
        cntd[di] += 1
    else:
        cntd[di] = 1
cntt = {}
for ti in t:
    if ti in cntt:
        cntt[ti] += 1
    else:
        cntt[ti] = 1

for k, v in cntt.items():
    if k not in cntd or cntd[k] < v:
        ans = "NO"
        break
print(ans)

Solution (Python):
N = int(input())
D = sorted(map(int, input().split()))
M = int(input())
T = sorted(map(int, input().split()))
i = 0
for t in T:
    while D[i] < t:
        i += 1
    if D[i] == t:
        i += 1
    else:
        print('NO')
        exit()
print('YES')

Solution (Python):
n = int(input())
a = sorted(list(map(int, input().split())))
m = int(input())
b = sorted(list(map(int, input().split())))
i = 0
for x in b:
    while i < n and a[i] < x:
        i += 1
    if i < n and a[i] == x:
        i += 1
    else:
        print('NO')
        exit(0)
print('YES')

Solution (Python):
from collections import Counter
n = int(input())
D = Counter(map(int,input().split()))
m = int(input())
T = Counter(map(int,input().split()))

print('YES' if all(D[i] >= T[i] for i in T) else 'NO')

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import re
import string

N = int(input())
D = map(int, input().split())
c = Counter(D)

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

ok = True
for t in T:
    if c[t] > 0:
        c[t] -= 1
    else:
        ok = False
        break
if ok:
    print("YES")
else:
    print("NO")

Solution (Python):
n = int(input())
d = dict()
a = [int(i) for i in input().split()]
for i in a:
    if i not in d.keys():
        d[i] = 0
    d[i] += 1
m = int(input())
for i in [int(j) for j in input().split()]:
    if i not in d.keys():
        print("NO")
        break
    d[i] -= 1
    if d[i] < 0:
        print("NO")
        break
else:
    print("YES")

Solution (Python):


from collections import Counter, defaultdict


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]


def main():
    N = int(input())
    D = map(int, input().split(" "))
    ds = defaultdict(int)
    for d in D:
        ds[d] += 1
    M = int(input())
    T = map(int, input().split(" "))
    for t in T:
        ds[t] -= 1
    for i in ds.values():
        if i < 0:
            return "NO"
    return "YES"


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

Solution (Python):
from collections import Counter


def solve(d, t):
    for ti, tc in t.items():
        if ti not in d:
            return False
        if d[ti] < tc:
            return False
    return True


input()
d = Counter(map(int, input().split()))
input()
t = Counter(map(int, input().split()))

print('YES' if solve(d, t) else 'NO')

Solution (Python):
ri = lambda: map(int, raw_input().split())
input()
d = dict()
for x in ri():
    if x not in d:
        d[x] = 0
    d[x] += 1
input()
for x in ri():
    if x not in d or d[x] == 0:
        print 'NO'
        quit()
    d[x] -= 1
print 'YES'

Solution (Python):
n = int(input())
D = map(int, input().split())
m = int(input())
T = map(int, input().split())
def count(A):
    B = {}
    for a in A:
        B[a] = B.get(a, 0) + 1
    return B

E = count(D)
U = count(T)

ok = 1
for u in U:
    if not U[u] <= E.get(u, 0):
        ok = 0
print("YES"*ok or "NO")

Solution (Python):

n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
d.sort()
t.sort()
j = 0
for t_i in t:
    while j < n and d[j] < t_i:
        j += 1
    if j == n or d[j] != t_i:
        result = False
        break
    j += 1
else:
    result = True
print(['NO', 'YES'][result])

Solution (Python):
from sys import stdin
n = int(stdin.readline())
di = {}
fi = {}
a = map(int,stdin.readline().split())
ans = 'YES'
for i in a:
 di[i] = di.get(i,0) + 1
m = int(stdin.readline())
b = map(int,stdin.readline().split())
for i in b:
 fi[i] = fi.get(i,0) + 1
for i in fi:
 if fi[i] > di.get(i,0):
  ans = 'NO'
print ans

Solution (Python):
from collections import Counter
input()
c1 = Counter(map(int, input().split()))
input()
c2 = Counter(map(int, input().split()))
print("YES" if all(c1[k] >= v for k, v in c2.items()) else "NO")

Solution (Python):

from collections import defaultdict

def solve():
    N = int(raw_input())
    D = map(int, raw_input().split())
    cnt = defaultdict(int)
    for di in D:
        cnt[di] += 1
    M = int(raw_input())
    T = map(int, raw_input().split())
    for ti in T:
        if cnt[ti] == 0:
            return False
        cnt[ti] -= 1
    return True

print "YES" if solve() else "NO"

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def main():
    n = I()
    d = LI()
    m = I()
    t = LI()
    c = collections.defaultdict(int)
    for k in d:
        c[k] += 1
    for k in t:
        if c[k] < 1:
            return 'NO'
        c[k] -= 1

    return 'YES'


print(main())