n = io.read('*n')
a = {}
for i = 1, n do
  local u = io.read('*n')
  if not a[u] then a[u] = 0 end
  a[u] = a[u] + 1
end

m = io.read('*n')
ans = true
for i = 1, m do
  local u = io.read('*n')
  if not a[u] or a[u] == 0 then
    ans = false
    break
  end
  a[u] = a[u] - 1
end
if ans then print('YES') else print('NO') end