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 java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException{
        BufferedReader rd=new BufferedReader(new InputStreamReader(System.in));
		int t=Integer.parseInt(rd.readLine());
		while(t-->0){
			String b[]=rd.readLine().split(" ");
			int n=Integer.parseInt(b[0]);
			int m=Integer.parseInt(b[1]);
			if(m==1){
				int a=(int)Math.sqrt(n);
				int p=1;
				for(int k=2;k<=a;k++){
					if(n%k==0){
						p=0;
						break;
					}
				}
				if(p==1)
				System.out.println("Yes");
				else
				System.out.println("No");
			}
			else{
			for(int i=2;i<=n/2;i++){
				boolean p=true;
				for(int j=2;j<=(int)Math.sqrt(i);j++){
					if(i%j==0){
					p=false;
					break;}
				}
				if(p){
					if((int)Math.pow(i,m)==n){
					System.out.println("Yes");
					break;}
					else if((int)Math.pow(i,m)>n){
						System.out.println("No");
						break;
					}
				}
			}
		}}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?