LogiQuest

132. Armstrong Number

EasyDigits

A k-digit number is an Armstrong number if the sum of its digits each raised to the power k equals the number (153 = 1³ + 5³ + 3³). Print YES or NO.

Input format

A single integer n.

Output format

YES or NO

Example 1

Input

153

Output

YES

Example 2

Input

370

Output

YES

Constraints

1 ≤ n ≤ 10¹⁸

Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.

Loading the MyLoginn IDE…