#C4061. Perfect Square Formation
Perfect Square Formation
Perfect Square Formation
In this problem, you are given an integer n which represents the number of pies. The task is to determine whether these pies can be arranged to form a perfect square, i.e., if there exists an integer x such that n = x2. Note that for negative n the answer is automatically NO because a negative number cannot be a perfect square.
Formally, you need to check whether:
Output YES if such an integer x exists; otherwise, output NO.
inputFormat
The input consists of a single line containing one integer n (-10^18 ≤ n ≤ 10^18
).
Input is provided through standard input (stdin).
outputFormat
Print YES if n is a perfect square; otherwise, print NO.
Output should be written to standard output (stdout).
## sample16
YES