Ankit_132

B

Oct 14th, 2023
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     long long int n;
  7.     cin>>n;
  8.    
  9.     while(n%2 == 0)     n /= 2;
  10.     while(n%3 == 0)     n /= 3;
  11.    
  12.     if(n == 1)      cout<<"Yes\n";
  13.     else            cout<<"No\n";
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment