IntermediateRating 1300
Two Squares
Print YES if n can be written as a² + b² with integers a, b ≥ 0, otherwise NO.
Input
One integer n (0 ≤ n ≤ 10¹²).
Output
YES or NO.
Sample 1
Input
5
Output
YES
Sample 2
Input
3
Output
NO
Output appears hereOne integer n (0 ≤ n ≤ 10¹²).
YES or NO.
5
YES
3
NO
Output appears here