Practical numbers P72581


Statement
 

pdf   zip

A practical number is a natural nn such that all smaller naturals can be represented as sums of distinct divisors of nn. For instance, 12 is a practical number, because all numbers from 1 to 11 can be expressed as sums of 1, 2, 3, 4, and 6: 5=2+35 = 2 + 3, 7=1+67 = 1 + 6, 8=2+68 = 2 + 6, 9=3+69 = 3 + 6, 10=1+3+610 = 1 + 3 + 6, and 11=2+3+611 = 2 + 3 + 6.

Given several naturals, are them practical numbers?

Input

Input consists of at most 50 naturals, all between 1 and 10610^6.

Output

For each given natural, print “yes” or “no” depending on whether it is a practical number or not.

Public test cases
  • Input

    1
    3
    12
    999998
    999999
    1000000
    

    Output

    yes
    no
    yes
    no
    no
    yes
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++