import java.util.Scanner; public class HelloWorld { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); sc.close(); boolean flag = false; for (int i=1; i < a / 3 ; i++) { int sum_now = 0; for (int j=i; ;j++) { if (sum_now > a) { break; } if (sum_now == a) { flag = true; break; } sum_now += j; } if (flag == true) { break; } } System.out.println(flag ? "YES" : "NO"); } }