Problem:


Score : 200 points

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.

Sample Input 1

123456789

Sample 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.

Sample Input 2

0

Sample Output 2

Yes

Sample Input 3

31415926535897932384626433832795028841971693993751058209749445923078164062862089986280

Sample Output 3

No



Sample input:
123456789


Sample output:
Yes

Submission status: Accepted

Solution code:
n = list(input())
a = [int(x) for x in n]
if sum(a) % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N=input()
ans=0
for i in N:
    ans+=int(i)
if ans%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
length = len(N)

a = 0
for i in range(length):
  a = a + int(N[i])
  
mod = a % 9
if mod == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N_st = input()
num = 0
for i in N_st:
    num += int(i)

if num % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def sum_digits(n: int) -> int:
    """
    各桁の和を取得する.

    Args:\n
        n (int): 整数

    Returns:\n
        int: 各桁の和
    """
    return sum(list(map(int, str(N))))


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 整数(0 <= N <= 10**200000)
    """
    # 求解処理
    ans = str()
    if sum_digits(N) % 9 == 0:
        ans = "Yes"
    else:
        ans = "No"

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N = get_input()

    # メイン処理
    main(N)

Submission status: Accepted

Solution code:
N = [int(c) for c in input().split()]

if sum(N) % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=list(map(int,list(input())))
if sum(n)%9==0:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
S = input()
su = 0
for c in S:
  su += int(c)
print('Yes' if su%9==0 else 'No')

Submission status: Accepted

Solution code:
n=int(input())
if n%9==0:
 print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

N = int(input())

if(N%9 == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
A = list(input())
B = [int(a) for a in A]
if sum(B)%9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
    N = input()
    sum_all_digits = 0

    for ch in N:
        sum_all_digits += int(ch)

    if sum_all_digits % 9 == 0:
        ans = "Yes"
    else:
        ans = "No"

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    N = input()
    total = 0
    for i in range(len(N)):
        total += int(N[i])
    if total % 9 == 0:
        print('Yes')
    else:
        print('No')
main()

Submission status: Accepted

Solution code:
print("Yes") if int(input())%9==0 else print("No")

Submission status: Accepted

Solution code:
n = input()

if sum([int(i) for i in n]) % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
print('Yes' if sum(list(map(int,input())))%9==0 else 'No')

Submission status: Accepted

Solution code:
n=int(input())
print('No' if n % 9 else 'Yes')

Submission status: Accepted

Solution code:
n = map(int, list(input()))
if sum(n) % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x = input()

sum_1 = 0
for item in x:
  sum_1 += int(item)

sum_1 = str(sum_1)
sum_2 = 0
for item in sum_1:
  sum_2 += int(item)

if sum_2 % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
mod = 0
n = input()
for d in n:
  mod = (mod + int(d)) % 9
if mod > 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n = str(input())
total = 0
for val in n:
    total += int(val)
print('Yes' if total % 9==0 else 'No')

Submission status: Accepted

Solution code:
N = sum(list(map(int, list(input()))))
print('Yes' if N%9 == 0 else 'No')

Submission status: Accepted

Solution code:
n = input()
s = 0
for i in n:
  x = int(i)
  s += x
if s%9 == 0:
  print ('Yes')
else:
  print ('No')

Submission status: Accepted

Solution code:
if int(input()) % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import numpy as np

N=int(input())
Nstr=list(str(N))
sum=0
for i in np.arange(len(Nstr)):
    sum+=int(Nstr[i])
    
if (sum%9==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math

def keta(s):
    if len(s) < 2:
        return int(s)
    n = sum(map(int, s))
    return keta(str(n))

def main():
    N = input()
    # N, X, T = list(map(int, input().split()))
    
    if keta(N) % 9 == 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
 
if N%9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
if n %9  == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()
total = 0

for i in N:
  total += int(i)

if total%9:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
N=input()
tmp=0
for i in N:
    tmp=tmp+int(i)
if tmp%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a = int(input())
N = [int(x) for x in list(str(a))]
#print(sum(N))
if sum(N)%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = str(input())

nine_mod = 0

for c in s:
    num = int(c)
    nine_mod += num
    nine_mod %= 9

if nine_mod == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=input()

wrk=0
for i in n:
    wrk+=int(i)

if wrk % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(str(n))

wrk=0
for i in l:
    wrk+=int(i)

if wrk % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = input()
sum = 0
for i in n:
    sum += int(i)
print("Yes" if sum % 9 == 0 else "No")

Submission status: Accepted

Solution code:
#B - Multiple9
N = str(input())
keta = len(N)
multi = 0
for i in range(keta):
    multi = (multi + int(N[i])) % 9
if multi == 0:
    # 出力
    print("Yes")
else:
    # 出力
    print("No")

Submission status: Accepted

Solution code:
n = map(int, list(input()))

ans = 0
for i in n:
    ans = (ans + i) % 3
print('Yes' if ans % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
n = int(input(''))

if n%9==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
if N % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
N_sum = sum([int(i) for i in N])
if N_sum % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
cou = 0
for i in range(len(n)):
    cou += int(n[i])
if cou % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
nn = map(int, n)
if sum(nn) % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=input()
tmp=0
for i in n:
  tmp+=int(i)

if tmp%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
a = 0
for i in range(len(n)):
    a = a + int(n[i])
if a % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=0
a=input()
l=len(a)
for i in range(l):
   s=s+int(a[i]) 
if(s%9==0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
ans = []
for i in range(len(N)):
  ans.append(int(N[i]))
Ans = sum(ans)
if Ans%9 ==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
R = len(str(N))
NS = str(N)
tmp = 0
for i in range(R):
    tmp += int(NS[i])
if tmp % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = list(input())
N = list(map(int, N))
if sum(N) % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    n = str(input())

    #output
    l = len(n)

    mod = 0
    for i in range(l):
        mod += int(n[i])
        mod %= 9 

    #  %%
    if mod == 0:
        print("Yes")
    else:
        print("No")

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = list(input().split())
l = len(N)
b = 0
for i in range(l):
    a = int(N[i])
    b = b + a
c = b % 9
if c == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N=input()
a=0
for i in range(len(N)):
    n=int(N[i])
    a=(a+n)%9
if a==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
num = input()
ans = 0
for i in num:
    ans += int(i)
    ans %= 9
if ans == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()

def tako(n):
    n = [int(i) for i in n]
    su = sum(n)
    if su%9 == 0:
        return 'Yes'
    else:
        return 'No'

print(tako(n))

Submission status: Accepted

Solution code:
n=int(input())

moji=str(n)
sum=0
for i in range(len(moji)):
  sum+=int(moji[i])

if sum%9==0:
  print("Yes")

else:
  print("No")

Submission status: Accepted

Solution code:
n_li = list(input())
judge = sum(map(int,n_li))
if judge%9 == 0 :
  print('Yes')
else :
  print('No')

Submission status: Accepted

Solution code:
# N = input()

# chk= 0
# for s in N:
#     chk += int(s)

# if chk % 9 == 0:
#     print('Yes')
# else:
#     print('No')

N = int(input())

if (N % 9) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
S = 0
for i in N:
  S+=int(i)

if S%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())

if N%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
Nstr = str(N)
eachNum = list(map(int, Nstr))
s = int(sum(eachNum))
if s % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()
nine = 0
for s in S:
  nine += int(s)
  
print('Yes' if nine % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
N=list(map(int,list(input())))

ans=0
for i in range(len(N)):
    ans+=N[i]
    ans%=9

if ans%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()

sum = 0

for i in range(len(N)):
  sum += int(N[i])
  
if sum % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

N = LI()

print("Yes" if sum(N) % 9 == 0 else "No")

Submission status: Accepted

Solution code:
n=input()
ans=0
for i in range(len(n)):
    ans+=int(n[i])
if ans%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = n % 9
if a == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
if n%9==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def solve(ns):
    d = 0
    for s in ns:
        d += int(s)
        d %= 9
    if d == 0:
        return 'Yes'
    else:
        return 'No'


def main():
    ns = input()
    res = solve(ns)
    print(res)


def test():
    assert solve("123456789") == 'Yes'
    assert solve("0") == 'Yes'
    assert solve("31415926535897932384626433832795028841971693993751058209749445923078164062862089986280") == 'No'


if __name__ == "__main__":
    test()
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: str):
    sum = 0
    for i in range(len(N)) :
        sum += int(N[i])
    if(sum % 9 == 0):
        print(YES)
    else :
        print(NO)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = next(tokens)  # type: str
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=list(map(int,list(input())))
if sum(N)%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    N = input()
    ans = sum(list(map(int, list(N))))
    print('No' if ans % 9 else 'Yes')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = input()
array = list(map(int,n))
sumarray = sum(array)
if sumarray%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
ans = 0
for moji in N:
    ans += int(moji)

if ans%9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a=int(input())%9

if a==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a = input()

score = int(a[0])
for i in list(a[1:]):
  score += int(i)

if score % 9 == 0 :
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

result = sum(list(map(int, str(n))))

if result % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
if(n%9 == 0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# N = input()
# sum = 0
# for n in N:
#     sum += int(n)
#     sum %= 9
# if sum == 0:
#     print("Yes")
# else:
#     print("No")
N = int(input())
if N % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
sum = 0
for n in N:
    sum += int(n)
    sum %= 9
if sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = list(input())
X = 0
for i in N:
    X += int(i)

print('Yes' if X%9 == 0 else 'No')

Submission status: Accepted

Solution code:
print('Yes' if sum(map(int, input())) % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

print('Yes' if N%9 == 0 else 'No')

Submission status: Accepted

Solution code:
n=input()
cnt=0
for x in n:
    cnt += int(x)
if cnt %9 ==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

# B - Multiple of 9
N = input()
digits = 0

for c in N:
	digits += int(c)

if digits % 9 == 0:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
n = input()

sm = 0
for v in n:
    sm += int(v)
if sm % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
sum_=0
for c in s:
    sum_ += int(c)
if sum_%9==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
c=0
for i in s:
	c+=int(i)
if(c%9==0):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
n=int(input())
if n%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
l = sum([int(i) for i in n])
if l%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
print('Yes' if n % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
from sys import stdin, stdout
t = int(stdin.readline())
if t % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()

res = 0
for i in n:
    res += int(i)
if res % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
sum_ = sum(map(int, N))
if sum_ % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

if n % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

if n%9 == 0:
  print('Yes')
  
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
print('Yes' if sum([int(r) for r in N]) % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
num= input()
eq=0
for x in range(len(num)):
    eq+=int(num[x])
   
if eq%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = list(input())
sum_N = 0
for i in range(len(N)):
    sum_N += int(N[i])

if sum_N % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()

x = 0
for c in n:
    x = (x + int(c)) % 9

if x == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=input()
a=len(n)
b=0
for i in range(a):
  b=b+int(n[i])
if b%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

if n % 9 == 0:
    print("Yes")
    exit()
else:
    print("No")
    exit()

Submission status: Accepted

Solution code:
A = 0
for i in input():
  A += int(i)
print("Yes" if A % 9 == 0 else "No")

Submission status: Accepted

Solution code:
if int(input())%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
l=list(map(int,list(input())))
s=sum(l)
if s%9==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N=int(input())
if(N%9==0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import math

def main():
    s = sum(list(map(int, input())))
    if s % 9==0:
        print('Yes')
    else:
        print('No')

if __name__=="__main__":
  main()

Submission status: Accepted

Solution code:
N = map(int, input())
print("Yes" if sum(N) % 9 == 0 else "No")

Submission status: Accepted

Solution code:
n = input()

N = 0

for i in n:
    N += int(i)

if N % 9 == 0:
    print("Yes")

else :
    print("No")

Submission status: Accepted

Solution code:
N=str(input())
total=0
for i in N:
    total+=int(i)
if (int(N)%9==0 and total%9==0):
    print('Yes')
elif N=='0':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
if N%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
 
ans = sum(map(int, N))
 
if ans % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N=int(input())

if N%9==0:
    print("Yes")
else:
        print("No")

Submission status: Accepted

Solution code:
s=input()
arr=[int(item) for item in s]
if sum(arr)%9==0:
  print ('Yes')
else:
  print ('No')

Submission status: Accepted

Solution code:
N = input()
sum = 0
for a in N:
  sum += int(a)

if (sum % 9) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
if n%9==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    s = input()
    total = 0

    for si in s:
        total += int(si)

    if total % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
num = input()
num_2 = 0
for i in range(0, len(num)):
  num_2 += int(num[i])
if num_2 % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()
sum = 0
for i in N:
    sum += int(i)
if sum % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
N_list = list(N)
N_list = [int(i) for i in N_list]
Sum = sum(N_list)
if Sum % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
num = input()
mod = 0
for i in range(len(num)):
  mod = ( mod + int(num[i]) ) % 9
if mod:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
import math
i = sum(list(map(int, input().split())))
print("Yes" if i % 9 == 0 else "No")

Submission status: Accepted

Solution code:
N = input()

sum = 0

for c in N:
    sum += int(c)
    sum = sum % 9

if sum % 9 == 0:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
N = input()

ans = sum(map(int, N))

if ans % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
l_n = list(input())
cnt = sum(map(int,l_n))

if(cnt%9==0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding:utf-8
n = int(input())
if n % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=input()
s=0
for x in n:
	s=(s+(ord(x)-48))%9
if (s%9==0):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
if __name__=="__main__":
  N=str(input())
  ans=0
  for i in N:
    ans+=int(i)
  if ans%9:
    print("No")
  else:
    print("Yes")

Submission status: Accepted

Solution code:
N=input()
sum=0
for n in N:
    sum+=int(n)

if sum % 9 ==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()

s = len(n)

ans = 0
for i in range(s):
  ans += int(n[i])

if ans%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
print(["No", "Yes"][int(bool(sum(list(map(int, input()))) % 9 == 0))])

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n = ini()
print("No" if n % 9 else "Yes")

Submission status: Accepted

Solution code:
n = int(input())

print("Yes" if n % 9 == 0 else "No")

Submission status: Accepted

Solution code:
n=[]
n+=input()
n=map(int,n)
if sum(n)%9==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
s = 0
for i in N:
  s += int(i)
print("No" if s%9 else "Yes")

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  if n % 9 == 0:
    print('Yes')
  else:
    print('No')
main()

Submission status: Accepted

Solution code:
N = list(input())
N = [int(i) for i in N]
S = sum(N)
if S%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
print("Yes" if sum([int(i) for i in N]) % 9 == 0 else "No")

Submission status: Accepted

Solution code:
import sys
cin = sys.stdin.readline
n = cin()
total = 0


for i in range(10):
    total += n.count(str(i)) * i
print("Yes" if total%9 == 0 else "No")

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n = list(map(int, ins()))
print("No" if sum(n) % 9 else "Yes")

Submission status: Accepted

Solution code:
n = input()
n = [int(x) for x in n]
sum = 0
for nn in n:
  sum += nn

if sum % 9 == 0:
  print('Yes')

else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())

if (n % 9) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
cin = sys.stdin.readline
n = list(cin())
ans = 0

n.pop(-1)
for i in n:
    ans += int(i)
if ans % 9 == 0:
    print('Yes')
else:
    print("No")

Submission status: Accepted

Solution code:
s, ans = (input()), 0
for i in s : 
    ans += int(i)
    ans %= 9 
if ans % 9 == 0: print('Yes')
else : print('No')

Submission status: Accepted

Solution code:
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

print("Yes" if sum(int(x) for x in input().split()) % 9 == 0 else "No")

Submission status: Accepted

Solution code:
N=input()

s=0
for c in N:
    s+=int(c)
if s%9==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

if N%9 ==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = map(int, list(input()))

if sum(n)%9 == 0:
    print("Yes")
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
length = int(len(N))
sum = 0

for i in range(length):
  sum += int(N[i])
  
if sum%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
if int(input()) % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N=int(input())
if(N%9==0):
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = rl().rstrip()
    N = sum(int(ni) for ni in N)
    print('Yes' if N % 9 == 0 else 'No')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = input()
a = 0
for i in range(len(N)):
  a += int(N[i])
if a % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()
s = 0
for i in n:
    s += int(i)
if s % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
i = int(input())
if i % 9:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n=input()
v=0
for i in range(len(n)):
    v+=int(n[i])
if v%9==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=list(input())
s=0
for x in n:
    s+=int(x)
if s%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
str_n = input().rstrip()
cnt = 0
for c in str_n:
  cnt += int(c)
if cnt%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()

l = []
for i in range(len(N)):
    l.append(int(N[i]))
if sum(l) % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = (input())
s = 0
for i in range(len(n)):
    s += int(n[-1 * i])
if s % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
hoge=list(input())
ans=0
for i in range(len(hoge)):
  ans+=int(hoge[i])
  
if(ans%9):
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n = str(input())

sm = 0

for i in range(len(n)):
  sm += int(n[i])
  
if sm % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def main():
    n = input()
    s = 0
    for i in range(len(n)):
        s += int(n[i])
        s = s%9
    if s == 0:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

if n%9 == 0:
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:
if int(input())%9==0 :
	print("Yes")
else :
	print("No")

Submission status: Accepted

Solution code:
n = map(str,input().split())

count = 0
for i in n:
    count += int(i)
if count % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input()) 
if N%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

s = map(int,list(input()))

ret = sum(s)%9
if ret == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#9の倍数の判定
mod = 9
arr = list(map(int, input()))
di = 0
for a in arr:
  di += a
  di = di%mod
if di == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()

t = 0

for i in n:
  t += int(i)

  
if t % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
print('No' if int(input()) % 9 else 'Yes')

Submission status: Accepted

Solution code:
n = input()

t = 0
for i in n:
    t += int(i)

if t % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N=input()
S=sum(map(int,N))
print('Yes' if S%9==0 else 'No')

Submission status: Accepted

Solution code:
s=[int(i) for i in input()]

print("Yes" if sum(s)%9==0 else "No")

Submission status: Accepted

Solution code:
n=int(input())
if n%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
print("No"if int(input())%9else"Yes")

Submission status: Accepted

Solution code:
a = int(input())

if a % 9:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
str = input()
l = len(str)
keigo = 0
for x in range(l):
  keigo += int(str[x])
if keigo % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = str(input())
cnt = 0
for i in range(len(N)):
    n = int(N[i])
    cnt += n

print("Yes") if cnt % 9 == 0 else print("No")

Submission status: Accepted

Solution code:
#B
n = int(input())

ans = "Yes" if n%9 == 0 else "No"
print(ans)

Submission status: Accepted

Solution code:
n = sum(list(map(int, input())))
if n%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n,t=input(),0

for i in range(len(n)):
  t+=int(n[i])

print('No' if t%9 else 'Yes')

Submission status: Accepted

Solution code:
N = int(input())
print("No" if N % 9 else "Yes")

Submission status: Accepted

Solution code:
N = input()
total = 0


for i in range(len(N)):
    total += int(N[i])
#print(total)
if total%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

#s = '31415926535897932384626433832795028841971693993751058209749445923078164062862089986280'

print('Yes' if sum(int(t) for t in s) % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
n = input()

mod = 0
for i in n:
    mod +=int(i)

if mod%9==0:
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
N = input()
n = len(N)
check = 0
for i in range(n):
    check += int(N[i])

print("Yes" if check % 9 == 0 else "No")

Submission status: Accepted

Solution code:
n=input()
array=list(map(int,n))
a=sum(array)
if a%9==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N=int(input())

if N%9==0:
  print("Yes")

else:
  print("No")

Submission status: Accepted

Solution code:
N = str(input())
cnt = 0
for i in range(10):
  cnt += i * N.count(str(i))
  
print('Yes' if cnt % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
n=int(input())
if(n%9==0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()
total = 0
for i in range(10):
    total += n.count(f'{i}') * i
print('Yes' if total%9==0 else 'No')

Submission status: Accepted

Solution code:
N = list(map(int, list(input())))
if sum(N) % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()

s_list = [int(i) for i in S]
if sum(s_list) % 9 == 0:
  print('Yes')
else:
  print('No')