#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> read() {
	int n;
	scanf("%d", &n);
	unordered_map<int, int> cnt;
	while (n --) {
		int x;
		scanf("%d", &x);
		cnt[x] ++;
	}
	return cnt;
}
int main() {
	unordered_map<int, int> c1 = read(), c2 = read();
	bool gg = 0;
	for (auto t : c2) gg |= t.second > c1[t.first];
	puts(gg ? "NO" : "YES");
}
