from collections import deque bufio_scanner = [] def main(): a = int(fmt_scan()) s = 0 ans = "NO" q = deque() for i in range(int(a / 3) + 10, 0, -1): q.append(i) s += i if s > a: s -= q.popleft() if s == a: ans = "YES" break print(ans) def fmt_scan() -> str: sc = bufio_scanner if len(sc) == 0: for v in input().split()[::-1]: sc.append(v) res = sc[-1] sc.pop() return res main()