import sys, math sys.setrecursionlimit(10**8) sys.set_int_max_str_digits(0) INF = 10**18 MOD = 998244353 from bisect import bisect_left, bisect_right from collections import deque, defaultdict, Counter from itertools import product, combinations, permutations, groupby, accumulate from heapq import heapify, heappop, heappush def I(): return sys.stdin.readline().rstrip() def II(): return int(sys.stdin.readline().rstrip()) def IS(): return sys.stdin.readline().rstrip().split() def MII(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(sys.stdin.readline().rstrip()) def TII(): return tuple(map(int, sys.stdin.readline().rstrip().split())) def LII(): return list(map(int, sys.stdin.readline().rstrip().split())) def LSI(): return list(map(str, sys.stdin.readline().rstrip().split())) def GMI(): return list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split())) def kiriage(a, b): return (a+b-1)//b def p(n:int, cnt:int): if cnt > 50: return cnt # 手順2 cnt += 1 if n == 1: return cnt # 終了 else: if n%2 == 0: n //= 2 else: n = 3*n + 1 cnt += 1 return p(n, cnt) N = int(input()) # 手順1は最初に一度だけカウントする ans = p(N, 1) if ans <= 50: print('Yes') print(ans) else: print('No')