Equal to product
Submissions: 25876   Accuracy:

28.38%

  Difficulty: Easy   Marks: 2

Given an array of positive integers. Check whether there are two numbers present with given product.

Input:
The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N and a product P.
The second line of each test case contain elements of array.

Output:
Print "Yes" (Without quotes) if two numbers product is equal to P else "No" (without quotes).

Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 107
0 ≤ Ai ≤ 263 - 1
0 <= P <= 264 - 1

Example:
Input:
2
5 25
1 2 3 4 5
8 63
5 7 9 22 15 344 92 8

Output:
No
Yes

** For More Input/Output Examples Use 'Expected Output' option **

Author: rajatjha


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.