from math import sqrt N=int(input()) def premier(x): for i in range(2,int(sqrt(x))+1): if x%i==0: return False return True if premier(N): print('N') else: k=sqrt(N) if int(k)**2==N and premier(k): print('N') else: print('Y')