#include<bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
#define ITER(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

multiset<int> S;
int main()
{
	//freopen("in.txt", "r", stdin);
	ios::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	FOR(i, 0, n)
	{
		int a;
		cin >> a;
		S.insert(a);
	}

	int m;
	cin >> m;
	FOR(i,0, m)
	{
		int a;
		cin >> a;
		multiset<int>::iterator it = S.find(a);
		if (it == S.end())
		{
			cout << "NO" << endl;
			return 0;
		}

		S.erase(it);
	}

	cout << "YES" << endl;
	return 0;
}
