AtCoder Beginner Contest 176
B
Multiple of 9
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

An integer $N$ is a multiple of $9$ if and only if the sum of the digits in the decimal representation of $N$ is a multiple of $9$.

翻译中…

Determine whether $N$ is a multiple of $9$.

翻译中…

Constraints

翻译中…
  • $0 \leq N < 10^{200000}$
  • $N$ is an integer.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N

翻译中…

Output

翻译中…

If $N$ is a multiple of $9$, print Yes; otherwise, print No.

翻译中…

样例

Input #1
123456789
Output #1
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$.
Input #2
0
Output #2
Yes
Input #3
31415926535897932384626433832795028841971693993751058209749445923078164062862089986280
Output #3
No
题目信息
题号
abc176_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。