CF2195A.Sieve of Erato67henes

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Sieve of Erato67henes

You are given nn positive integers a1,a2,,ana_1,a_2,\ldots,a_n.

Please determine if it is possible to select any number of elements in aa, so that their product is 6767.

Note that you may not select zero elements, as the product of zero elements is not defined in this problem.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1041 \le t \le 10^4). The description of the test cases follows.

The first line of each test case contains a single integer nn (1n51 \le n \le 5).

The second line of each test case contains nn positive integers a1,a2,,ana_1,a_2,\ldots,a_n (1ai671 \le a_i \le 67).

Output

If it is possible to select elements so that their product is 6767, output "YES" on one line. Otherwise, output "NO" on one line.

You can output the answer in any case. For example, the strings "yEs", "yes", and "Yes" will also be recognized as positive responses.

Note

In the first test case, you can select a1a_1 and a5a_5 to get a1a5=167=67a_1\cdot a_5 = 1 \cdot 67 = 67.

In the second test case, it is impossible to select any number of elements so that their product is 6767.

Samples

2
5
1 7 6 7 67
5
1 3 5 7 8
YES
NO

在线编程 IDE

建议全屏模式获得最佳体验