#include <bits/stdc++.h>
#define MAX 10000
using namespace std;


int main(){
	int n;
	while(cin>>n){
		if(n == 0)
			break;
		int k = sqrt(n);
		bool flag = true;
		for(int i = 2; i <= k && flag; i++){
			int pf = pow(i,2);
			if(n % pf == 0)
				flag = false;
		}
		if(!flag)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
		
		
	}

}