~/algor $ cat problems/sonlar-kvadratsiz-sonmi
Is it square-free
Easy
1000 ms
128 MB
27%
A positive integer $n$ is called square-free if it is not divisible by any perfect square greater than one ($4, 9, 16, 25, \ldots$). For example, $30$ is square-free, while $18$ is divisible by $9$. Print YES if the given $n$ is square-free, otherwise NO.
Input
One positive integer $n$.
Output
YES or NO.
Note
$1 \le n \le 10^{12}$
Examples
Input #1
30
Output #1
YES
Input #2
18
Output #2
NO