BETA

Difficulty Level: Easy

Total Submissions: 709 Accuracy:

26.09%

Check a Integer is power of 3 or not
     

Given a positive integer, write a function to find if it is a power of three or not.

Input:
First line consists of T test cases. Only line of every test case consists of a 32-bit integer N.

Output:
Single line output, print "Yes" if integer is a power of 3 else "No"

Constraints:
1<=T<=100
1<=N<=(32-bit largest integer)

Example:
Input:

2
3
6
Output:
Yes
No

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.