A = int(input()) B = 2 * A divisors = set() for i in range(1, int(B**0.5) + 1): if B % i == 0: divisors.add(i) divisors.add(B // i) found = False for k in divisors: if k >= 3: quotient = B // k if (quotient - k + 1) % 2 == 0: found = True break print("YES" if found else "NO")