import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    auto n = lread();
    auto d = aryread();
    auto m = lread();
    auto t = aryread();
    long[long] dd;
    foreach (i; 0 .. n)
    {
        dd[d[i]] = dd.get(d[i], 0) + 1;
    }
    // writeln(dd);
    long[long] tt;
    foreach (i; 0 .. m)
    {
        tt[t[i]] = tt.get(t[i], 0) + 1;
    }
    // writeln(tt);
    foreach (key, value; tt)
    {
        if (key in dd)
        {
            if (dd[key] < value)

            {
                writeln("NO");
                return;
            }
        }
        else
        {
            writeln("NO");
            return;
        }

    }
    writeln("YES");
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}
