#include<cstdio>
#include<algorithm>
using namespace std;
int n,m,k,a[200001],b[200001];
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++)scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	scanf("%d",&m);
	for (int i=1;i<=m;i++)scanf("%d",&b[i]);
	sort(b+1,b+m+1);
	k=1;
	for (int i=1;i<=m;i++,k++)
	{
		while ((k<=n)&&(a[k]!=b[i]))k++;
		if (a[k]!=b[i])
		{
			printf("NO");
			return 0;
		}
	}
	printf("YES");
}