HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Perfect numbers

Section problems

• Sum until 0
• Flowchart 1
• Flowchart 2
• Flowchart 3
• Name-Surname
• Wonder primes
• Round numbers
• Sum less than N
• Perfect numbers
• Sum of N numbers
• How many digits?
• find the numbers
• Fibonacci Series
• SAME OR DIFFERENT
• Binary to decimal
• Decimal to binary
• How many divisors?

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

A perfect number is a natural number and when you add up all of the factors less than that number, you get that number. The first two perfect numbers are 6 and 28. 1+2+3 = 6, and 1+2+4+7+14 = 28.

Make a program that finds out if the given number is perfect or not.

Input

There is a single integer N on the first line (0 < N < 1012).

Output

Write "Yes" if N is perfect and "No" otherwise.

Example

stdin stdout

6

Yes

5 No
Для отправки решений необходимо выполнить вход.

www.contester.ru