#include using namespace std; int main() { int x,y,n,i,j,a; cin>>x>>y; cin>>n; for(i=1;i<=n;++i) { cin>>a; if((x*y)%a==0)cout<<"YES";else cout<<"NO"; }return 0; }