Geeky Power
Submissions: 118   Accuracy:

9.33%

  Max. Score:

30

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.

Input :
First line of input contains testcases T. For each testcase, there will be two positive integers n and m.

Output :
For each testcase, in a new line, print "YES" or "NO" (without quotes).

Constraints :
1 <= T <= 10
1 <= n <= 106
1 <= m <= 106

Example :
Input :

2
16 4
16 3

Output:
YES
NO

Explanation :
16 is m-th (4th) power of 2, where 2 is prime.


to report an issue on this page.