a = int(input()) * 2 for i in range(1, int(a ** 0.5) + 1): if a % i == 0: if i + 1 == a // i and i >= 3: print('YES') exit() print('NO')