n = int(input()); s = 2
while n!=1 and s<=48: n = 3*n+1 if n%2 else n//2; s += 2
if n==1: print("Yes"); print(s)
else: print("No")