P15057 [UOI 2023 II Stage] Roads of Potokolandiya
Description
In Potokoland, there are $n$ cities and $n$ two-way roads. The $i$-th road connects cities $i$ and $(i+i)$ (if $i+i>n$, then $i+i-n$).
For example, if $n=5$, the roads will be $(1, 2)$, $(2, 4)$, $(3, 1)$, $(4, 3)$, and $(5, 5)$.
Determine if it is possible to travel from any city to any other city using the roads. If not, find a pair of cities that are not connected.
Input Format
The first line contains one integer $n$ ($1 \leq n \leq 10^6$).
Output Format
Output $\tt{YES}$ if it is possible to travel from any city to any other city.
Otherwise, output $\tt{NO}$ on the first line. On the second line, output any two cities $a$ and $b$ ($1 \leq a, b \leq n$; $a \neq b$) such that it is impossible to travel from $a$ to $b$ using the roads.