#include<bits/stdc++.h>
using namespace std;
const int N=200010;
int n,m,a[N],b[N];
map<int,int> cnt;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);cnt[a[i]]++;
	}
	scanf("%d",&m);
	for(int i=1;i<=m;i++){
		scanf("%d",&b[i]);
		if(!cnt[b[i]]) return puts("NO"),0;
		cnt[b[i]]--;
	}
	puts("YES");
	return 0;
}