#include <bits/stdc++.h>
#define int long long
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

signed main(){
	int n,m;
	cin>>n;
	vector<int>a(n);
	r(i,n)cin>>a[i];
	cin>>m;
	vector<int>b(m);
	r(i,m)cin>>b[i];
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	cout<<includes(a.begin(),a.end(),b.begin(),b.end())<<endl;
}
