Perfect Number
A number is perfect if it equals the sum of its proper divisors (divisors excluding itself). Is N perfect?
Input: one integer N.
Output: YES or NO.
Constraints:
- 1 ≤ N ≤ 1010
Sample Tests
Input 1
28
Output 1
YES
Input 2
12
Output 2
NO
Discussion (opens after you solve — no spoilers before)
No comments yet.