For this Question: Andrew loves to solve problems related to prime numbers. One of Andrew's friend has asked him to solve below problem for him. 
Given two positive integers <b>N</b> and <b>M</b>, the task is to check that N is the Mth power of a <b>prime number</b> or not.First line of input contains testcases <b>T</b>. For each testcase, there will be two positive integers N and M.

Constraints :
1 <= T <= 100
2 <= N <= 10^6
1 <= M <= 10For each testcase you need to print "<b>Yes</b>" if N is the Mth power of a prime number otherrwise "<b>No</b>". Input :
2
16 4
16 3

Output:
Yes
No

Explanation :
16 is m-th (4th) power of 2, where 2 is prime., I have written this Solution Code: import math
def mroot(n,m):
	check = round(n**(1/m))
	# print(check)
	if check**m == n:
		return check
	else:
		return -1
def prime(n,m):
	check = mroot(n,m)
	if check == -1:
		return "No"
	if check == 2:
		return "Yes"
	for i in range(2, int(math.sqrt(check))+1):
		if n%i == 0:
			return "No"
	return "Yes"
T = int(input())
for _ in range(T):
	n,m = list(map(int, input().split()))
	print(prime(n,m)), In this Programming Language: Python, Now tell me if this Code is compilable or not?