puts (0..N=gets.to_i).bsearch{|n|s=n
s+=n/=2while n>0
N<=>s}?:YES: :NO