check = set() s = 1 t = 10**6 check.add(0) for i in range(2*(10**6)): s += 2*i - 1 check.add(s%t) N = int(input()) if N in check: print('YES') else: print('NO')