import java.util.Arrays; import java.util.Scanner; public class Main { void run() { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); for (int t = 60; t >= 1; --t) { if ((n - ((1L << t) - 1)) >= 0) n -= (1L << t) - 1; } if(n==0) System.out.println("YES"); else System.out.println("NO"); } public static void main(String[] args) { new Main().run(); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }