#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#include<utility>
#include<numeric>

#define PB push_back
#define all(a)  (a).begin(),(a).end()
#define ALL(v) begin(v), end(v)
#define DWN(a)  (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define V vector<int>
#define VV vector<V>
#define VVV vector<VV>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int inf = (int)1e9;
const ll INF = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };
const long double EPS = 1e-10;

int n, m;
int d[200010], t[200010];
map<int, int> mapd, mapt;

int main() {
	cin >> n;
	rep(i, n) cin >> d[i];
	cin >> m;
	rep(i, m) cin >> t[i];

	rep(i, n) mapd[d[i]]++;
	rep(i, m) mapt[t[i]]++;

	rep(i, n) {
		if (mapt[t[i]] > mapd[t[i]]) {
			cout << "NO" << endl;
		}
	}

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