INF = 1 << 60 N = int(input()) def collatz(x, step): if step > 50: return INF if x == 1: return step + 1 elif x % 2 == 0: return collatz(x // 2, step + 2) else: return collatz(3 * x + 1, step + 2) step = collatz(N, 1) if step <= 50: print('Yes') print(step) else: print('No')