import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

bool calc(int[] ds, int[] ts) {
    int[int] map;
    foreach (d; ds)
        map[d]++;

    foreach (t; ts) {
        int x = map.get(t, 0);
        if (x > 0) {
            map[t]--;
        }
        else {
            return false;
        }
    }
    return true;
}

void main() {
    readint;
    auto ds = readints;
    readint;
    auto ts = readints;

    writeln(calc(ds, ts) ? "YES" : "NO");
}
