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

int main(){
	int n; cin >> n;
	multiset<ll> s;
	for(int i = 0; i < n; ++i){
		ll d; cin >> d;
		s.insert(d);
	}
	int m; cin >> m;
	for(int i = 0; i < m; ++i){
		ll t; cin >> t;
		auto ite = s.find(t);
		if(ite  != s.end()){
			s.erase(ite);
		}else{
			cout << "NO\n";
			return 0;
		}
	}
	cout << "YES\n";
	return 0;
}