#include <iostream>
#include <map>
using namespace std;

int main() {
	int N, M, D, T;
	bool check = true;
	map<int, int> mp;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> D;
		mp[D]++;
	}
	cin >> M;
	for (int i = 0; i < M; i++) {
		cin >> T;
		if (mp[T] == 0) check = false;
		else mp[T]--;
	}
	if (check) puts("YES");
	else puts("NO");
}