from sys import maxsize bufio_scanner = [] def main(): a = int(fmt_scan()) yes = False x, y = 0, 0 i, j = 0, -1 while True: while True: i += 1 x = i * (i + 1) // 2 if x - y >= a: break while True: j += 1 y = j * (j + 1) // 2 if x - y <= a: break if i - j <= 1: break if i - j >= 3 and x - y == a: yes = True break print("YES" if yes else "NO") def fmt_scan() -> str: sc = bufio_scanner if len(sc) == 0: for v in reversed(input().split()): sc.append(v) return sc.pop() main()