#K10026. Perfect Number Checker
Perfect Number Checker
Perfect Number Checker
Given a positive integer n, determine whether it is a perfect number. A number is considered perfect if it is equal to the sum of its proper divisors (i.e., all divisors excluding the number itself). Mathematically, n is perfect if
$$ n = \sum_{d|n, d<n} d $$
Your task is to check whether the given number satisfies this property.
inputFormat
The input consists of a single integer n (1 ≤ n ≤ 10^5). It is read from standard input.
outputFormat
Output a single line containing "YES" if n is a perfect number; otherwise, output "NO". The output is written to standard output.## sample
6
YES