eolymp
bolt
Try our new interface for solving problems
Problems

Frame paving

Frame paving

Frame x * y is rectangle x * y with center rectangle (x - 2) * (y - 2) dropped out. We have many tiles a * 1. Is it possible to cave frame x * y with tiles a * 1?

For example, frame 5 * 6 can be tiled with tiles 3 * 1, but not with tiles 4 * 1.

prb8376.gif

Input

The first line contains two positive integers x and y (3x, y106). The second line contains one positive integer n (1n1000) - number of tile types. The third line contains n positive integers less than 106 - lengths of tiles.

Output

Print n lines with YES or NO. i-th line contains YES if it is possible to tile the frame with tiles of i-th type. Output NO otherwise.

Time limit 1 second
Memory limit 128 MiB
Input example #1
5 6
2
3 4
Output example #1
YES
NO