Given two numbers n and m. Your task is to find if n is Geeky-m-Power-of-Prime.
Geeky-m-Power-of-Prime : A number is called Geeky-m-Power-of-Prime if it is mth power of a prime number.
First line of input contains testcases T. For each testcase, there will be two positive integers n and m.
For each testcase, in a new line, print "YES" or "NO" (without quotes).
1 <= T <= 10
1 <= n <= 106
1 <= m <= 106
16 is m-th (4th) power of 2, where 2 is prime.