#K2161. Armstrong Number Checker

    ID: 24676 Type: Default 1000ms 256MiB

Armstrong Number Checker

Armstrong Number Checker

An Armstrong number (also known as a narcissistic number) is a number that is equal to the sum of its own digits each raised to the power of the number of digits. For example, \(153 = 1^3 + 5^3 + 3^3\) and \(9474 = 9^4 + 4^4 + 7^4 + 4^4\). Note that by definition, single-digit numbers (including 0) are Armstrong numbers.

Your task is to determine whether each given number is an Armstrong number.

inputFormat

The input is read from standard input (stdin). The first line contains an integer \(T\) representing the number of test cases. Each of the following \(T\) lines contains a single integer \(N\) which needs to be checked.

outputFormat

For each test case, output a single line with the string "YES" if \(N\) is an Armstrong number, and "NO" otherwise.

## sample
3
153
9474
123
YES

YES NO

</p>