#include #include int main() { int k,n,i; long x,y,nr_blocks; scanf("%d%d", &x, &y); scanf("%d", &n); nr_blocks = (x * 2) + ( y - 2 ) * 2; for ( i = 0; i < n; i++) { scanf("%d", &k); if( ! (nr_blocks % k )) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }