Submit | All submissions | Best solutions | Back to list |
EIEVERYN - Every Number |
Check if array of m numbers have every number from 1..n
Input
T: Number of testcases (1 <= T <= 20)
For each testcase:
+ 2 integers m and n (1 <= m, n <= 10^5)
+ m integers ai (ai <= 10^9, 0<=i < m)
Output
For each testcase, print "Yes" if array has every number from 1..n, otherwise print "No" (Without quote)
Example
Input:
2 4 3 1 3 2 1 7 6 5 2 1 2 2 5 3
Output:
Yes No