#include using namespace std; using ll = long long; int main(){ ll N, cnt=2; cin >> N; for (int i=0; i<25; i++){ if (N == 1) break; if (N % 2 == 0) N /= 2; else N = N*3+1; cnt += 2; } if (N != 1) cout << "No" << endl; else cout << "Yes\n" << cnt << endl; return 0; }