HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Perfect numbers

Section problems

• REVERSE ORDER OF WORDS
• Factorial
• Maximum
• Name-Surname
• Decimal to binary
• Heap
• Herons
• Leap Year
• Perfect numbers
• Rectangle
• Bfs
• Chess
• Big Dance
• Binary to decimal
• Circle
• City Tour
• Dijkstra

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