Armstrong number
A number is an Armstrong number if it equals the sum of its digits each raised to the number of digits (153 = 1³ + 5³ + 3³). Print YES or NO.
Reported in: HCLTech, Accenture (memory-based)
Input
One line: N.
Output
YES or NO.
Constraints
0 ≤ N ≤ 10^9.
Example 1
Input:
153
Output:
YESExample 2
Input:
123
Output:
NOHint: Count the digits first, then add digit^count for each digit.