Perfect numbers
A number is perfect if it equals the sum of its divisors smaller than itself (6 = 1 + 2 + 3). For a given number n ≤ 1012 print YES if it is perfect, and NO otherwise.
Example 1
Input
6Output
YESExample 2
Input
28Output
YESExample 3
Input
12Output
NOExample 4
Input
137438691328Output
YES