The Bermuda Triangle

No attempts yetTime limit1sMemory limit128 MB

Problem

In a hidden region of the Bermuda Triangle, people make everything they need in the shape of triangles. One day someone decided to break the rule and baked a cake shaped like a regular hexagon. As usual, though, the cake has to be served in triangular pieces. Every piece is an equilateral triangle, and different people receive pieces of different sizes. He may use as many triangular pieces as he needs, and the whole cake must be cut into these pieces so that nothing is left over.

For example, the figure below shows one way a regular hexagon of side 99 can be cut into equilateral triangles of side 22 and side 33. (The cake is cut along the thick lines; the thin lines are drawn only to show the sizes.)

Given the side length of a regular hexagon and a set of allowed triangle sizes (each described by its side length), decide whether the hexagon can be completely divided into equilateral triangles whose side lengths all come from the given set. Each allowed size may be used any number of times, including zero.

Input

The first line contains a single integer tt (1t101 \le t \le 10), the number of test cases. Each of the next tt lines describes one test case. A line begins with ss (1s251 \le s \le 25), the side length of the hexagon, followed by nn (1n101 \le n \le 10), the number of triangle types, followed by nn integers giving the side length of each triangle type (each between 11 and 2525, inclusive).

Output

For each test case, output a single line containing YES if the hexagon can be completely divided using the given triangle types, or NO otherwise.