5306: ABC176——Task B:9 的倍数(Multiple of 9)
[Creator : ]
Description
一个整数 N ,将 N 的每一位求和,可以得到一个数。如果这个数是 9 的倍数,哪么 N 也是 9 的倍数。
判断整数 N 是否是 9 的倍数。
An integer NN is a multiple of 99 if and only if the sum of the digits in the decimal representation of NN is a multiple of 99.
Determine whether NN is a multiple of 99.
判断整数 N 是否是 9 的倍数。
An integer NN is a multiple of 99 if and only if the sum of the digits in the decimal representation of NN is a multiple of 99.
Determine whether NN is a multiple of 99.
Input
一行一个整数 N。
$0 \leq N < 10^{200000}$
$0 \leq N < 10^{200000}$
Output
如果 N 是 9 的倍数,输出 Yes。否则输出 No。
Sample 1 Input
31415926535897932384626433832795028841971693993751058209749445923078164062862089986280
Sample 1 Output
No
Sample 2 Input
123456789
Sample 2 Output
Yes
The sum of these digits is $1+2+3+4+5+6+7+8+9=45$, which is a multiple of $9$, so $123456789$ is a multiple of $9$.
Sample 3 Input
0
Sample 3 Output
Yes