def P(n): cnt = 0 nn = n cnt+=1 while nn!=1 and cnt<=50: cnt+=1 if nn%2==0: nn//=2 cnt+=1 else: nn=3*nn+1 cnt+1 cnt+=1 return cnt import sys input = sys.stdin.readline N = int(input()) cnt = P(N) if cnt<=50: print("Yes") print(cnt) else: print("No")