#import <Foundation/Foundation.h>
typedef long long Int;
int compare(const void *a, const void *b) {
    return *(Int *)a - *(Int *)b;
}
int main() {
    Int n;
    scanf("%lld", &n);
    Int *a = malloc(sizeof(Int) * n);
    for (Int i = 0; i < n; i++) scanf("%lld", a + i);
    Int m;
    scanf("%lld", &m);
    Int *b = malloc(sizeof(Int) * m);
    for (Int i = 0; i < m; i++) scanf("%lld", b + i);
    qsort(a, n, sizeof(Int), compare);
    qsort(b, m, sizeof(Int), compare);
    Int j = 0;
    for (Int i = 0; i < m; i++) {
        while (b[i] > a[j]) {
            j++;
            if (j >= n) {
                puts("NO");
                return 0;
            }
        }
        if (b[i] == a[j]) {
            j++;
            continue;
        } else {
            puts("NO");
            return 0;
        }
    }
    puts("YES");
}