#C2361. Check Narcissistic Numbers

    ID: 45669 Type: Default 1000ms 256MiB

Check Narcissistic Numbers

Check Narcissistic Numbers

Given an integer \( T \) and \( T \) numbers, determine for each number whether it is a Narcissistic number. A Narcissistic number is a number that is equal to the sum of its digits raised to the power of the number of digits. Formally, for a number \( N \) with \( m \) digits, it is narcissistic if:

\( N = d_1^m + d_2^m + \ldots + d_m^m \)

Your task is to check each number and print "Yes" if it satisfies the condition, otherwise print "No".

inputFormat

The input begins with an integer \( T \), representing the number of test cases. Each of the following \( T \) lines contains a single integer \( N \).

outputFormat

For each test case, output "Yes" if the number is a Narcissistic number, otherwise output "No". Each answer should be printed on a new line.

## sample
3
153
9474
123
Yes

Yes No

</p>