local n=io.read("*n","*l")
local d={}
for i=1,n do
    local x=io.read("*n")
    if not d[x] then
        d[x]=1
    else
        d[x]=d[x]+1
    end
end
local m=io.read("*n","*l")
local t={}
for i=1,m do
    local y=io.read("*n")
    if not t[y] then
        t[y]=1
    else
        t[y]=t[y]+1
    end
end

for i,_ in pairs(t) do
    if t[i]>d[i] then
        print("NO")
        return    
    end
end
print("YES")