let factorize n = let rec go x i = if i * i > x then [x] elif x % i = 0L then i :: go (x / i) i else i + 1L |> go x go n 2L let n = stdin.ReadLine() |> int64 let cond = n |> factorize |> List.groupBy id |> List.map (snd >> List.length) |> List.forall (fun x -> x % 3 = 0) if cond then "Yes" else "No" |> printfn "%s"