Definition of Perfect number:
A perfect number is a positive integer that is equal to the sum of its proper positive divisors excluding the number itself. By this definition, 1 is not a perfect number.
Explanation:
Take number 6.
Proper positive divisors of 6 is 1,2,3 and their sum is 1+2+3=6.
So, 6 is a perfect number.
So, 6 is a perfect number.
Input: A single positive number x
Output:
yes if given number x is a perfect number
yes if given number x is a perfect number
no if given number x is not a perfect number
Example 1:
Input: 6
Output: yes
Example 2:
Input: 7
Output: no
Implementation: