package finalset;


import java.util.Hashtable;
import java.util.Scanner;

/**
 * An integer N is "exponent unique" if its prime decomposition contains no 
 * prime factor P that appears the same number of times as another prime factor Q.  
 * 
 * Given a number N (in the range 1 <=  N <= 2147483647 determine whether N is 
 * "exponent unique".                         
 */
public class Problem1 {
	static Hashtable<Integer,Integer> counts = new Hashtable<Integer,Integer>();
	
	public static void main (String args[]) {
		Scanner sc = new Scanner (System.in);
		int N = Integer.valueOf(sc.nextLine()).intValue();
		
		System.out.println (isExponentUnique(N));
	}
	
	public static void reset() {
		counts =  new Hashtable<Integer,Integer>();
	}
	
	// helper function.
	public static boolean isExponentUnique(int n) {
		return isExponentUnique(n, 2);
	}
	
	/** 
	 * Determine if n is "exponent unique". 
	 * 
	 * Note that we are constantly checking primes in increasing order, so we
	 * optimize by recursively passing in the next one to check.
	 * 
	 */
	public static boolean isExponentUnique(int n, int start) {
		// if we get here, then we are done!
		if (n == 1) return true;
		
		int max = 1+(int) Math.sqrt(n);
		
		// find each factor, count it, place in hashtable
		for (int i = start; i <= max; i++) {
			if (i*(n/i) == n) {
				// found one. Remove all factors, and then try again, recursively.
				int ct = 1;
				n = n / i;
				while (n != 0 && n %i == 0) {
					ct++;
					n = n / i;
				}
				
				// If already there, exit now. o/w add there.
				if (counts.get(ct) != null) {
					return false;
				}
				
				counts.put(ct, i);
				
				return isExponentUnique(n, i+1);
			}
		}
		
		// check for prime count of 1
		if (counts.get(1) != null) { return false; }
		counts.put(1, n); 
		return true;
	}
}
