All problems

Armstrong Number Check

easyPythonMath

A puzzle column runs a feature on self-describing numbers and the editor wants submissions checked before they go to print. The property in question is called an Armstrong number: raise every digit to the power of how many digits the number has, add the results, and an Armstrong number comes back as itself. 153 has three digits, and 1³ + 5³ + 3³ is 153.

Task: Read a number and report whether it has that property.

Input

A single line holding one integer n, with 1 ≤ n ≤ 999,999. There is no sign and no leading zero.

Output

One line holding exactly Yes if the number has the property, or exactly No if it does not. Capital first letter, no quotes.

Example:

Input:
153

Output:
Yes

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…