#include using namespace std; int main(){ int a,b,n,x,i,v[1010]; cin>>a>>b>>n; for(i=1;i<=n;i++) cin>>v[i]; for(i=1;i<=n;i++) if(a%v[i]==0) {if((b-2)%v[i]==0) cout<<"YES"<<"\n";} else if(b%v[i]==0) {if((a-2)%v[i]==0) cout<<"YES"<<"\n";} else cout<<"NO"<<"\n"; return 0; }