#include <bits/stdc++.h>

using namespace std;

int main() {
	int n, m, t;
	scanf("%d", &n);
	map<int, int> s;
	for (int i = 0; i < n; i++) {
		scanf("%d", &t);
		s[t]++;
	}
	scanf("%d", &m);
	for (int i =0; i < m; i++) {
		scanf("%d", &t);
		if (s[t] <= 0) {
			printf("NO\n");
			return 0;
		}
		s[t]--;
	}
	printf("YES\n");
}