Under construction

Still being built. Things may change

Bobby Tables

Time limit2sMemory limit512 MB

Summary
Given the prime factorization of X and a bound m, find n and k with 0 <= k <= n <= m and X = C(n, k), or report NO.
Level

Medium7 of 10

Topics
Number theory, Combinatorics, Brute force
Solved
No attempts yet

Problem

Little Bobby Tables stores his favorite big numbers in his database. Those numbers take a lot of memory, so he is trying to find a more efficient way to store them.

The database holds a number XX with no large prime factors. Bobby suspects that XX has the form X=(nk)X = \binom{n}{k} for some relatively small integers nn and kk.

Given an integer mm and the prime factorization of XX, determine whether there exist integers nn and kk such that 0≤k≤n≤m0 \le k \le n \le m and X=(nk)X = \binom{n}{k}.

Input

The first line contains the number of test cases zz (1≤z≤10 0001 \le z \le 10\,000). Each test case is described as follows.

The first line of a test case contains two integers tt and mm (1≤t,m≤150 0001 \le t, m \le 150\,000), where tt is the number of primes in the factorization of XX and mm is the upper bound for the output values.

The second line contains tt primes p1,…,ptp_1, \ldots, p_t (2≤pi≤m2 \le p_i \le m) whose product is XX.

The sum of tt over all test cases does not exceed 200 000200\,000. The sum of mm over all test cases does not exceed 2 000 0002\,000\,000.

Output

For each test case, if there exist suitable nn and kk, print "YES" on the first line and the values of nn and kk on the second line. Otherwise, print only "NO" on one line.

Examples1

  1. Example 1

    Input
    2
    2 5
    3 2
    3 7
    2 2 2
    
    Expected output
    YES
    4 2
    NO