N = int(input()) cnt = 0 op = 1 while cnt < 50: match op: case 1: cnt += 1 op = 2 case 2: cnt += 1 op = N==1 and 4 or 3 case 3: N = N%2 and 3*N+1 or N//2 cnt += 1 op = 2 case 4: print("Yes") print(cnt) break else: print("No")