#B4036. Beautiful Numbers

    ID: 11693 Type: Default 1000ms 256MiB

Beautiful Numbers

Beautiful Numbers

Xiao Yang considers a positive integer to be a beautiful number if and only if the sum of its digits is a multiple of \(7\). Given \(n\) positive integers, your task is to determine which of them are beautiful numbers.

Definition: A positive integer \(x\) is beautiful if \(\sum_{i} d_i \equiv 0 \; (\bmod\; 7)\), where \(d_i\) are the digits of \(x\).

inputFormat

The first line contains a single integer \(n\) denoting the number of positive integers.

The second line contains \(n\) positive integers separated by spaces.

outputFormat

For each of the \(n\) integers, output a line containing Yes if the number is beautiful, or No otherwise.

sample

3
34 70 1234
Yes

Yes No

</p>