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

#define rep(i, n) for  (int i = 0; i < (int)n; i++)
#define vec vector

int main(void)
{
	map<int, int> mp;
	int n,  m;
	cin >> n;
	rep(i, n) {
		int d;
		cin  >> d;
		mp[d]++;
	}
	cin >> m;
	rep(i, m) {
		int t;
		cin >>  t;
		if (!mp[t]) {
			printf("NO\n");
			return 0;
		}
		mp[t]--;
	}
	printf("YES\n");
	return 0;
}