CodeEff/ECCO huggingface dataset:
# Original solution
X = int(eval(input()))
if X < 100:
    print((0))
else:
    item = [100, 101, 102, 103, 104, 105]
    dp = [[False for _ in range(X//100+10)] for _ in range(X+10)]
    dp[0][0] = True
    dp[100][1] = True
    dp[101][1] = True
    dp[103][1] = True
    dp[102][1] = True
    dp[105][1] = True
    for x in range(200, X+1):
        for n in range(2, x//100+1):
            for i in item:
                if dp[x-i][n-1]:
                    dp[x][n] = True
                    if x == X:
                        break
    if True in dp[X]:
        print((1))
    else:
        print((0))

# Optimized solution
X = int(eval(input()))
dp = [False for _ in range(X+1)]
dp[0] = True
for x in range(X+1):
    if x > 99:
        item = [100, 101, 102, 103, 104, 105]
        for i in item:
            if dp[x-i]:
                dp[x] = True
if dp[X]:
    print((1))
else:
    print((0))
# Original solution
s=str(eval(input()))
if int(s) < 100:
    print((0))
else:
    x = int(s[-2:])
    a,b = divmod(x,5)
    k = a + (1 if b else 0)
    if k * 100 <= int(s) - x:
        print((1))
    else:
        print((0))


# Optimized solution
s=int(eval(input()))
print((int((s%100+4)//5*100<=s)))
# Original solution
X = int(eval(input()))
C = 1000000

output = []
for c in range(C):
    if (c*100) <= X <= (c*105):
        output.append(1)
    else:
        output.append(0)
if max(output):
  print("1")
else:
  print("0")

# Optimized solution
def one_int():
    return int(eval(input()))

N=one_int()
num=int(N/100) 
amari = N % 100
if num*5 < amari:
    print((0))
else:
    print((1))
# Original solution
X = int(eval(input()))

if X < 100:
    print((0))
    exit()


def dfs(zan):
    if zan <= 0:
        if zan == 0:
            print((1))
            exit()
        else:
            return

    dfs(zan - 100)
    dfs(zan - 101)
    dfs(zan - 102)
    dfs(zan - 103)
    dfs(zan - 104)
    dfs(zan - 105)


dfs(X)
print((0))

# Optimized solution
X = int(eval(input()))

if X < 100:
    print((0))
    exit()

if X % 100 == 0:
    print((1))
    exit()

cnt = X // 100
zan = X % 100

if zan > cnt * 5:
    print((0))
else:
    print((1))
# Original solution
x = int(eval(input()))
dp = [0]*(x+105+1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x+1):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print((dp[x]))

# Optimized solution
x = int(eval(input()))
dp = [0]*(x + 105 + 1)
dp[100] = 1 
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100,x-105+100):
    for j in range(100,106):
        dp[i+j] = max(dp[i] , dp[i+j])

print((dp[x]))
# Original solution
from sys import stdin
from itertools import combinations_with_replacement

x = int(stdin.readline().rstrip())

li = [0,1,2,3,4,5]

kosuu = x//100
amari = x%100

lin = list(combinations_with_replacement(li, kosuu))

for i in lin:
    if sum(i) == amari:
        print((1))
        exit()

print((0))

# Optimized solution
from sys import stdin
from itertools import combinations_with_replacement

x = int(stdin.readline().rstrip())

li = [0,1,2,3,4,5]

kosuu = x//100
amari = x%100

if amari > kosuu*5:
    print((0))
else:
    print((1))
# Original solution
X= int(eval(input()))
x=int(X/100)+1


for a in range(x):
    cost0 = 0
    cost0 += 100 * a
    if cost0 > X:
        break
    if cost0 == X:
        print((1))
        exit()

    for b in range(x):
        cost1 = cost0 + 101 * b
        if cost1 > X:
            break
        if cost1 == X:
            print((1))
            exit()

        for c in range(x):
            cost2 = cost1 + 102 * c
            if cost2 > X:
                break
            if cost2 == X:
                print((1))
                exit()

            for d in range(x):
                cost3 = cost2 + 103 * d
                if cost3 > X:
                    break
                if cost3 == X:
                    print((1))
                    exit()

                for e in range(x):
                    cost4 = cost3 + 104 * e
                    if cost4 > X:
                        break
                    if cost4 == X:
                        print((1))
                        exit()

                    for f in range(x):
                        cost5 = cost4 + 105 * f
                        if cost5 > X:
                            break
                        if cost5 == X:
                            print((1))
                            exit()
print((0))


# Optimized solution
X=int(eval(input()))
n=X//100
s=X-n*100
if s > 5*n:
    print((0))
else:
    print((1))
# Original solution
#!/usr/bin/env python3

x = int(eval(input()))

ok = False

def dfs(n, flg):
    global ok
    if flg:
        return 
    if n == x:
        ok = True
        return
    if n > x:
        ok = False
        return
    dfs(n+100, ok) 
    dfs(n+101, ok) 
    dfs(n+102, ok) 
    dfs(n+103, ok) 
    dfs(n+104, ok) 
    dfs(n+105, ok) 

dfs(0, False)
if ok: print((1))
else: print((0))


# Optimized solution
#!/usr/bin/env python

x = int(eval(input()))

n = x//100

for i in range(n+1):
    tmp = x 
    tmp -= i*100
    if 5*i >= tmp:
        print((1))
        exit()
print((0))
# Original solution
import math
x = y = 0
theta = 90
while True:
    d, a = list(map(int, input().split(',')))
    if d==a==0:
        break
    x += d * math.cos(theta * math.pi / 180)
    y += d * math.sin(theta * math.pi / 180)
    theta -= a
print((int(x)))
print((int(y)))

# Optimized solution
import math
x = y = 0
ang = 90
while True:
    d, a = list(map(int, input().split(',')))
    if d == a == 0:
        break
    rad = ang * math.pi / 180
    x += d * math.cos(rad)
    y += d * math.sin(rad)
    ang -= a
print((int(x)))
print((int(y)))
# Original solution
import math
pi=3.14159265358979

def radians(x):
    return 1.0*x/180*pi
    
x = 0
y = 0
theta = radians(90)

while True:
    a, b = list(map(float, input().split(',')))
    if a==0 and b==0: break
    x += a * math.cos(theta)
    y += a * math.sin(theta)
    theta += radians(-b)

print(int(x))
print(int(y))

# Optimized solution
import math
pi=3.14159265358979

x = 0
y = 0
theta = math.radians(90)

while True:
    a, b = list(map(float, input().split(',')))
    if a==0 and b==0: break
    x += a * math.cos(theta)
    y += a * math.sin(theta)
    theta += math.radians(-b)

print(int(x))
print(int(y))
# Original solution
while True:
    N,M = list(map(int,input().strip().split(" ")))
    if [N,M] == [0,0]:
        break
    D = 0 #目的地までの総距離
    L = []
    for i in range(N):
        d,p = list(map(int,input().strip().split(" ")))
        for j in range(d):
            L.append(p)
        D = D + d
    L.sort()
    S = 0 #Sが襲われる回数の期待値
    for k in range(D-M):
        S = S + L[k]
    print(S)


# Optimized solution
while True:
    N,M = list(map(int,input().strip().split(" ")))
    if [N,M] == [0,0]:
        break
    L = []
    S = 0
    for i in range(N):
        l = list(map(int,input().strip().split(" ")))
        l.reverse()
        L.append(l)
        S = S + l[0]*l[1]
    L.sort()
    for j in range(0,N):
        t = N-j-1
        if M >= L[t][1]:
            S = S - L[t][0]*L[t][1]
            M = M - L[t][1]
        elif 0 < M:
            S = S - L[t][0]*M
            M = M - L[t][1]
    print(S)
# Original solution
x,y,z = list(map(int, input().split()))
a = []
a.append(x)
a.append(y)
a.append(z)
a.sort()
print((a[0]+a[1]))

# Optimized solution
x = list(map(int,input().split()))
x.sort()
print((x[0]+x[1]))
# Original solution
import math

a, b, c = list(map(int, input().split()))
print((min(a + b, b + c, c + a)))

# Optimized solution
import math

a = [int(i) for i in input().split()]
print((sum(a) - max(a)))
# Original solution
a = list(map(int,input().split()))
print((sum(a) - max(a)))


# Optimized solution
#!/usr/bin/env python3
a = list(map(int,input().split()))
print((sum(a)-max(a)))
# Original solution
a, b, c = sorted(map(int, input().split()))
print((a+b))

# Optimized solution
a,b,c=list(map(int,input().split()))
print((min(a+b,a+c,b+c)))
# Original solution
a,b,c=sorted(map(int,input().split()))
print((a+b))

# Optimized solution
l=list(map(int,input().split()))
print((sum(sorted(l)[:2])))
# Original solution
a, b, c = list(map(int, input().split()))
print((min(a+b, b+c, c+a)))

# Optimized solution
abc = list(map(int, input().split()))
print((sum(sorted(abc)[:2])))
# Original solution
i = sorted(list(map(int, input().split())))
print((i[0] + i[1]))


# Optimized solution
print((sum(sorted(list(map(int, input().split())))[:2])))
# Original solution
a, b, c = list(map(int, input().split(" ")))
print(("%d"%(a+b+c - max(max(a, b), c))))

# Optimized solution
a, b, c = list(map(int, input().split(" ")))
print((min(a+b, b+c, c+a)))
# Original solution
a, b, c = list(map(int,input().split()))
x = a + b
y = a + c
z = b + c
print((min(x,y,z)))

# Optimized solution
A, B, C = list(map(int,input().split()))
print((min(A+B, A+C, B+C)))
# Original solution
cart = [4,1,4,1,2,1,2,1]
while True:
	try:
		que = list(map(int, input().split()))
		mx,mxcart = 0, "99999999"
		for sp in range(8):
			sm = 0
			for num in range(8):
				if cart[(sp+num)%8] <= que[num]:
					sm += cart[(sp+num)%8]
				else:
					sm += que[num]
			if sm > mx:
				mx = sm
				mxcart = "".join(map(str, cart[sp:]+cart[:sp]))
			elif sm == mx:
				acart = "".join(map(str, cart[sp:]+cart[:sp]))
				if int(mxcart) > int(acart):
					mxcart = acart
		print(" ".join(map(str, mxcart)))
	except:
		break

# Optimized solution
c = [4,1,4,1,2,1,2,1]
while True:
	try:
		que = list(map(int, input().split()))
		mx,mxc = 0, "99999999"
		for sp in range(8):
			sm = 0
			for num in range(8):
				sm += c[(sp+num)%8] if c[(sp+num)%8] <= que[num] else que[num]
			if sm > mx:
				mx = sm
				mxc = "".join(map(str, c[sp:]+c[:sp]))
			elif sm == mx:
				ac = "".join(map(str, c[sp:]+c[:sp]))
				if int(mxc) > int(ac):
					mxc = ac
		print(" ".join(map(str, mxc)))
	except:
		break
# Original solution
import sys
from collections import Counter

N = int(sys.stdin.readline())
D = list(map(int, sys.stdin.readline().split()))
M = int(sys.stdin.readline())
T = list(map(int, sys.stdin.readline().split()))

diffs = Counter(D)
problems = Counter(T)

for diff, count in list(problems.items()):
    if diff not in diffs:
        break
    if diffs[diff] < count:
        break
else:
    print("YES")
    sys.exit()

print("NO")

# Optimized solution
import sys
from collections import Counter

input = sys.stdin.readline
N = int(eval(input()))
D = list(map(int, input().split()))
M = int(eval(input()))
T = list(map(int, input().split()))

counter = Counter(D)
for t_i in T:
    if t_i in counter and 0 < counter[t_i]:
        counter[t_i] -= 1
    else:
        print("NO")
        sys.exit()

print("YES")
# Original solution
import collections

n = int(eval(input()))
ln = list(map(int, input().split()))
m = int(eval(input()))
lm = list(map(int, input().split()))

c = collections.Counter(lm)

for i in list(c.keys()):
    if ln.count(i) < c[i]:
        print("NO")
        exit()

print("YES")

# Optimized solution
import sys
from collections import Counter
 
N = int(eval(input()))
s1 = list(map(int,input().split()))
M = int(eval(input()))
s2 = list(map(int,input().split()))
 
c1 = Counter(s1)
c2 = Counter(s2)
 
for k,v in list(c2.items()):
    if k in c1:
        if v > c1[k]:
            print('NO')
            sys.exit()
    else:
        print('NO')
        sys.exit()
print('YES')
# Original solution
import sys
from collections import Counter
 
N = int(eval(input()))
s1 = list(map(int,input().split()))
M = int(eval(input()))
s2 = list(map(int,input().split()))
 
c1 = Counter(s1)
c2 = Counter(s2)
 
for k,v in list(c2.items()):
    if k in c1:
        if v > c1[k]:
            print('NO')
            sys.exit()
    else:
        print('NO')
        sys.exit()
print('YES')

# Optimized solution
import collections

n = int(eval(input()))
ln = list(map(int, input().split()))
m = int(eval(input()))
lm = list(map(int, input().split()))

c1 = collections.Counter(lm)
c2 = collections.Counter(ln)

for i in list(c1.keys()):
    if c2[i] < c1[i]:
        print("NO")
        exit()

print("YES")
# Original solution
def resolve():
    def main():

        n=int(eval(input()))
        d=list(map(int,input().split()))
        m=int(eval(input()))
        t=list(map(int,input().split()))
        from collections import Counter
        dd=Counter(d)
        tt=Counter(t)
        ddkey=list(dd.keys())
        ddvalue=list(dd.values())
        for x,y in list(tt.items()):
            flag=True
            if x in ddkey and ddvalue[ddkey.index(x)]>=y:
                continue
            else:
                return 'NO'
        return 'YES'
    print((main()))
resolve()

# Optimized solution
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():

        n=int(eval(input()))
        d=list(map(int,input().split()))
        m=int(eval(input()))
        t=list(map(int,input().split()))
        from collections import Counter
        dd=Counter(d)
        tt=Counter(t)
        for key,value in list(tt.items()):
            if dd[key]<value:
                return 'NO'
        return 'YES'
    print((main()))
resolve()
# Original solution
n=int(eval(input()))
d=list(map(int,input().split()))
m=int(eval(input()))
t=list(map(int,input().split()))
a=True
for i in t:
    if i in d:
        j=d.index(i)
        d=d[:j]+d[j+1:]
    else:
        a=False
        break
print(('YES' if a else 'NO'))

# Optimized solution
n=int(eval(input()))
d=list(map(int,input().split()))
m=int(eval(input()))
t=list(map(int,input().split()))
dd=dict()
td=dict()
for i in d:
    if i in dd:
        dd[i]+=1
    else:
        dd[i]=1
for i in t:
    if i in td:
        td[i]+=1
    else:
        td[i]=1
for i,j in list(td.items()):
    if i not in dd:
        print('NO')
        exit()
    elif dd[i]<j:
        print('NO')
        exit()
print('YES')
# Original solution
import math
import collections
import fractions
import itertools

def solve():
    n = int(eval(input()))
    d = list(map(int, input().split()))
    m = int(eval(input()))
    t = list(map(int, input().split()))
    t = collections.Counter(t)
    for i in t:
        if t[i] > d.count(i):
            print("NO")
            break
    else:
        print("YES")
    return 0

if __name__ == "__main__":
    solve()

# Optimized solution
import math
import collections
import fractions
import itertools

def solve():
    n = int(eval(input()))
    d = list(map(int, input().split()))
    m = int(eval(input()))
    t = list(map(int, input().split()))
    t = collections.Counter(t)
    d = collections.Counter(d)
    for i in t:
        if t[i] > d[i]:
            print("NO")
            break
    else:
        print("YES")
    return 0

if __name__ == "__main__":
    solve()
# Original solution
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_c=Counter(d)
t_c=Counter(t)
for i in list(t_c.keys()):
    if t_c[i]>d_c[i]:
        print('NO')
        exit()
print('YES')

# Optimized solution
from sys import stdin
nii=lambda:list(map(int,stdin.readline().split()))
lnii=lambda:list(map(int,stdin.readline().split()))
from collections import Counter

n=int(eval(input()))
d=lnii()
m=int(eval(input()))
t=lnii()

c=Counter(d)
for i in t:
  if c[i]==0:
    print('NO')
    exit()
  else:
    c[i]-=1

print('YES')
# Original solution
def binarySearch(list_a, key):
    left = 0
    right = len(list_a)
    while left < right:
        mid = (left + right) // 2
        if list_a[mid] == key:
            return mid
            break
        elif key < list_a[mid]:
            right = mid
        else:
            left = mid+1
    else:
        return "NOT_FOUND"

n = int(eval(input()))
list_d = list((list(map(int, input().split()))))
m = int(eval(input()))
list_t = list((list(map(int, input().split()))))

list_d.sort()

for number in list_t:
    ind = binarySearch(list_d, number)
    if ind != "NOT_FOUND":
        del list_d[ind]
    else:
        print("NO")
        break
else:
    print("YES")


# Optimized solution
n = int(eval(input()))
list_d = list((list(map(int, input().split()))))
m = int(eval(input()))
list_t = list((list(map(int, input().split()))))

dict_d = {}
dict_t = {}
for number in set(list_d):
    dict_d[number] = 0
for number in set(list_t):
    dict_d[number] = 0
for number in list_d:
    dict_d[number] += 1

for number in set(list_t):
    dict_t[number] = 0
for number in list_t:
    dict_t[number] += 1

for number,value in list(dict_t.items()):
    if dict_d[number] < value:
        print("NO")
        break
    else:
        pass
else:
    print("YES")
# Original solution
N=int(eval(input()))
D=list(map(int,input().split()))
M=int(eval(input()))
T=list(map(int,input().split()))
D.sort()
T.sort()
from collections import Counter
D=Counter(D)
dic_D={}
for i in D.most_common():
  dic_D[i[0]]=i[1]
T=Counter(T)
ret = 'YES'
for i in T.most_common():
  if i[0] in dic_D:
    if dic_D[i[0]]<i[1]:
      ret = 'NO'
      break
  else:
    ret = 'NO'
    break
print(ret)

# Optimized solution
N=int(eval(input()))
D=list(map(int,input().split()))
M=int(eval(input()))
T=list(map(int,input().split()))
from collections import Counter
D=Counter(D)
dic_D={}
for i in D.most_common():
  dic_D[i[0]]=i[1]
T=Counter(T)
ret = 'YES'
for i in T.most_common():
  if i[0] in dic_D:
    if dic_D[i[0]]<i[1]:
      ret = 'NO'
      break
  else:
    ret = 'NO'
    break
print(ret)
# Original solution
n = int(eval(input()))
d = input().split()
m = int(eval(input()))
t = input().split()

for x in t:
    if x in d:
        d.remove(x)
    else:
        print('NO')
        exit()

print('YES')


# Optimized solution
n = int(eval(input()))
d = input().split()
m = int(eval(input()))
t = input().split()

d.sort()
t.sort()
a = 0

for x in t:
    for i in range(a, n):
        if d[i] > x:
            print('NO')
            exit()
        if x == d[i]:
            a = i+1
            break

print('YES')
# Original solution
from collections import Counter

n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t = list(map(int, input().split()))

dc, tc = Counter(d), Counter(t)
ans = "YES"
for p in list(tc.keys()):
    if tc[p] > dc[p]:
        ans = "NO"

print(ans)


# Optimized solution
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)

f = True
for df in list(t.keys()):
    f &= (d[df] >= t[df])

print((["NO", "YES"][f]))
# Original solution
n = eval(input())
d = list(map(int, input().split()))
m = eval(input())
t = list(map(int, input().split()))

dic = {}
for i in d:
    if i in list(dic.keys()):
        dic[i] += 1
    else:
        dic[i] = 1
for i in t:
    if i in list(dic.keys()):
        dic[i] -= 1
        if dic[i] == 0:
            del(dic[i])
    else:
        print('NO')
        exit()
print('YES')

# Optimized solution
def main():
    n = int(eval(input()))
    d = list(map(int, input().split()))
    m = int(eval(input()))
    t = list(map(int, input().split()))
    d.sort()
    t.sort()
    x = -1
    y = -1
    while x < n and y < m-1:
        x += 1
        y += 1
        while x < n and d[x] != t[y]:
            x += 1
    if x < n:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main()
# Original solution
from collections import Counter
n,d,m,t,ans=int(eval(input())),Counter(list(map(int,input().split()))),int(eval(input())),Counter(list(map(int,input().split()))),"YES"
for i in list(t.keys()):
  if i in list(d.keys()):
    if d[i]<t[i]:ans="NO"
  else:ans="NO"
print(ans)

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
from collections import Counter
d=Counter(a)
m=int(eval(input()))
b=list(map(int,input().split()))
dd=Counter(b)
for i in dd:
  if i not in d:
    print("NO")
    exit()
  if d[i]<dd[i]:
    print("NO")
    exit()
print("YES")
# Original solution
import collections

n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t = list(map(int, input().split()))

d_c = collections.Counter(d)
t_c = collections.Counter(t)

ans = 'YES'
for e in list(t_c.items()):
    diff, cnt = e[0], e[1]
    if d_c[diff]:
        if d_c[diff] < cnt:
            ans = 'NO'
            break
    else:
        ans = 'NO'
        break
    
print(ans)

# Optimized solution
import collections

n = int(eval(input()))
d = list(map(int, input().split()))
m = int(eval(input()))
t = list(map(int, input().split()))

d_c = collections.Counter(d)
t_c = collections.Counter(t)

ans = 'YES'
for e in list(t_c.items()):
    if d_c[e[0]]:
        if d_c[e[0]] < e[1]:
            ans = 'NO'
            break
    else:
        ans = 'NO'
        break
    
print(ans)
# Original solution
from collections import Counter
import sys

N = int(eval(input()))
D = list(input().split())

M = int(eval(input()))
T = list(input().split())

D_count = Counter(D)
T_count = Counter(T)

for k in T_count:
    if D_count[k] < T_count[k]:
        print('NO')
        sys.exit()

print('YES')


# Optimized solution
from collections import Counter
import sys

N = int(eval(input()))
D = list(input().split())

M = int(eval(input()))
T = list(input().split())

D_count = Counter(D)
T_count = Counter(T)

for k, v in list(T_count.items()):
    if D_count[k] < v:
        print('NO')
        sys.exit()

print('YES')
# Original solution
n=int(eval(input()))
d=list(map(int,input().split()))
m=int(eval(input()))
t=list(map(int,input().split()))
for i in t:
  if i in d:
    del d[d.index(i)]
  else:
    print("NO")
    exit()
print("YES")

# Optimized solution
n=int(eval(input()))
d=list(map(int,input().split()))
m=int(eval(input()))
t=list(map(int,input().split()))
d.sort()
t.sort()
i,j=0,0
while i<m:
  if t[i]<d[j]:
    print("NO")
    exit()
  elif t[i]==d[j]:
    i+=1
    j+=1
  else:
    j+=1
  if j==n and i<m:
    print("NO")
    exit()
print("YES")
# Original solution
import collections

n = int(eval(input()))
dd = list(map(int, input().split()))
m = int(eval(input()))
tt = list(map(int, input().split()))
cd = collections.Counter(dd)
ct = collections.Counter(tt)

if m > n:
  print('NO')
  exit()
        

for t in tt: 
  if t in dd and ct[t] <= cd[t]:
    continue
  else:
    print('NO')
    exit()
print('YES')


# Optimized solution
import collections
n = int(eval(input()))
d_list = list(map(int, input().split()))
m = int(eval(input()))
t_list = list(map(int, input().split()))

if m > n:
    print("NO")
    exit()

d_c = collections.Counter(d_list)
t_c = collections.Counter(t_list)

for i in t_c:
    if t_c[i] <= d_c[i]:
        continue
    else:
        print("NO")
        exit()

print("YES")
# Original solution
n = int(eval(input()))
d = list(map(int,input().split()))
m = int(eval(input()))
t = list(map(int,input().split()))


for i in range(m):
    try:
        z = d.index(t[i])
    except ValueError:
        print('NO')
        exit(0)
    else:
        d.pop(z)

print('YES')

# Optimized solution
n = int(eval(input()))
d = list(map(int,input().split()))
m = int(eval(input()))
t = list(map(int,input().split()))
d.sort()
t.sort()
j = 0
for i in range(n):
    if d[i] == t[j]:
        j += 1
    if j == m:
        break

if j == m:
    print('YES')
else:
    print('NO')
# Original solution
from collections import Counter 

N=int(eval(input()))
C = Counter(list(map(int,input().split())))
O=int(eval(input()))
M = Counter(list(map(int,input().split())))
for key in list(M.keys()):
  if C[key]<M[key]:
    print("NO")
    break
else:
  print("YES")


# Optimized solution
from collections import Counter
N = int(eval(input()))
D=list(map(int,input().split()))
M = int(eval(input()))
T=list(map(int,input().split()))

C=Counter(D)

for t in T:
    if C[t]<=0:
        print("NO")
        exit()
    else:
        C[t]-=1
print("YES")