#include<iostream>
using namespace std;

int main()
{
	int x, y, a,t;
	cin >> x >> y>>t;
	while (t)
	{
		cin >> a;
		if (x%a == 0 && (y - 2) % a == 0 && (y-2))
			cout << "Yes\n";
		else
		if ((x - 1) % a == 0 && (y - 1) % a == 0)
			cout << "Yes\n";
		else
		if ((x - 2) % a == 0 && y%a == 0 && (x-2))
			cout << "Yes\n";
		else
			cout << "No\n";
		t--;
	}
	
}