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

multiset<int> s;
int m,n,x;
int main()
{
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d",&x);
        s.insert(x);
    }
    scanf("%d",&m);
    while(m--)
    {
        scanf("%d",&x);
        if(s.find(x)==s.end()){puts("NO");return 0;}
        s.erase(s.find(x));
    }
    puts("YES");
    return 0;
}