N, = map(int, input().split()) N*=2 c = 3 f=1 while c*c <= N: if N%c==0: if N//c > c: print("YES") f = 0 break c += 1 if f: print("NO")