Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/mukammal-sonmi

Perfect number?

Easy 1000 ms 64 MB 23%
Share

A positive integer $n$ is given. A number is called perfect if it equals the sum of all its positive divisors smaller than itself (for example, $6 = 1 + 2 + 3$). Print YES if $n$ is a perfect number, otherwise NO.

The number 28 and its divisors smaller than it; their sum equals the number itself

Input

One positive integer $n$.

Output

YES or NO.

Note

$1 \le n \le 10^{6}$

Examples

Input #1
28
Output #1
YES
Input #2
12
Output #2
NO

Sign in to submit a solution

Signing up is free and takes a minute.