A = int(input()) i = 0 for n in range(2, A): #range(3, A) chk = A - n * (n-1)//2 if chk < 0: break if chk % n == 0: print('Yes') i = 1 break if i == 0: print('No')