import java.util.*; public class Main { static int n; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); if (calc(0, 1)) { System.out.println("YES"); } else { System.out.println("NO"); } } static boolean calc(int s, int t) { s += t; if (s == n) { return true; } else if (s > n) { return false; } t *= 2; if (calc(s, t)) { return true; } else { return calc(s, t + 1); } } }