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)
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")
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)

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")

+n = int(eval(input())) +a = list(map(int, input().split())) -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) +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")