#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <algorithm>

using namespace std;

map<int, int> D;
int N,M,T;

int main()
{
	cin >> N;
	for(int i=0;i<N;i++)
	{
		cin >> T;
		D[T]++;
	}
	cin >> M;
	while(M--)
	{
		cin >> T;
		if(D[T]--<=0)
		{
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}