407214: GYM102697 185 Pleasing Numbers
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
185. Pleasing Numberstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output This problem is worth 15 points.
You consider a number to be a pleasing number if it contains no prime factors other than 2 and 3. For example, 1, 4, 12, 18, and 81 are pleasing numbers, while 7, 28, 210, and 30 are not pleasing numbers.
Given a number, figure out whether or not it is a pleasing number.
InputThe only line of input consists of a single positive integer $$$n$$$ less than or equal to 1000.
OutputIf $$$n$$$ is a pleasing number, as described above, output "YES" (no quotes). Otherwise, output "NO" (no quotes).
ExamplesInput18Output
YESInput
35Output
NO