#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m;int a[224514],b[224514];
map<int,int>mp;
signed main(){
	cin>>n;
	rep(i,n)cin>>a[i];
	cin>>m;
	rep(i,m)cin>>b[i];
	rep(i,n)mp[a[i]]++;
	rep(i,m){
		if(mp[b[i]])mp[b[i]]--;
		else {
			puts("NO");
			return 0;
		}
	}
	puts("YES");
}
