x = int(input())*2
for k in range(3, 10**5):
    if x%k:
        continue
    temp = x // k
    temp -= k-1
    if temp%2 == 0:
        print("YES")
        exit()
print("NO")