#include<bits/stdc++.h>
using namespace std;
unsigned long long int a[300000];
int main(){
	freopen("match.out","r",stdin);
	int n,i;
	unsigned long long int x;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	    scanf("%lld",&a[i]);
	//cout<<"AAAAAAAAAA"<<endl;
	freopen("match3.ans","r",stdin);
	scanf("%d",&n);
	bool t=true;
	for(i=1;i<=n;i++){
		scanf("%lld",&x);
		if(x!=a[i]){
			cout<<i<<":"<<x<<" "<<a[i]<<endl;
			t=false;
			break;
		}
	}
	if(t)cout<<"yes";
	else cout<<"no";
}
