Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- long long int n;
- cin>>n;
- while(n%2 == 0) n /= 2;
- while(n%3 == 0) n /= 3;
- if(n == 1) cout<<"Yes\n";
- else cout<<"No\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment