# No.1256 連続整数列 # https://yukicoder.me/problems/no/1256 a = int(input()) for i in range(3, 10 ** 5): r = a - i * (i + 1) // 2 if r >= 0 and r % i == 0: print("YES") exit() print("NO")