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:
def sum(n):
    s=0
    for i in n:
        s=s+int(i)
    return s
n=input()
a=sum(n)
if (a%9==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())
array = list(map(int, N))
S = sum(array)

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

Submission status: Accepted

Solution code:
N = input()
if N == 0:
  print('Yes')
else:
  N = str(N)
  L = list(N)
  L = [int(s) for s in L]
  X = sum(L)
  if X % 9 == 0:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
import sys
n= int(input())
A=list(map(int, str(n)))
s=0
b=len(A)
for i in range(b):
    s=s+A[i]%9
if s%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:
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 =str(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:
N=input()
sum=0
for i in N:
    sum+=int(i)
if sum%9==0 and int(N)%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = input()

# print(len(A))

sum = 0
for i in range (0, len(A)):
    sum += int(A[i])

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

else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(str(input()))
n = [int(i) for i in n]
total = sum(n)

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
L = str(input())
sum = 0
for i in range(len(L)):
    sum = sum + int(L[i])

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
strN = str(N)
wa = 0
for i in strN:
  wa += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC176 B
N = list(map(int,input()))
n = 0
for i in N:
  n += i

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

Submission status: Accepted

Solution code:
import collections 

N = input()
D = collections.Counter(N)
ret = 0
for c in D.keys():
  ret += int(c) * D[c]
  ret = ret % 9
  
if ret  == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = str(input())
list_N = list(N)
list_N = [int(s) for s in list_N]
ans = 0
for i in range(len(list_N)):
    ans += list_N[i]
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:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input()) 
ans = sum(list(map(int, str(n)))) % 9

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

Submission status: Accepted

Solution code:
N = input()

total = 0
for n in N:
    total += int(n)

ans = 'Yes' if total % 9 == 0 else 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
char_list = list(str(N))
result = 0
for i in char_list:
    result = result + int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list_N =list(map(int,list(input())))
total = 0
for i in list_N:
    total += i
if total % 9 == 0:
    print("Yes")
elif total % 9 != 0:
    print("No")
else:
    pass

Submission status: Accepted

Solution code:

def main():
    n = input()
    counter = 0
    for c in n:
        counter += int(c)
    if counter % 9 == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
total = 0

for i in str(n):
    total += int(i)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
number = int(input())

sum_of_digits = sum(int(digit) for digit in str(number))

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

Submission status: Accepted

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

import math

if __name__ == '__main__':
    N_str = input()
    N_array = list(map(int, N_str))
    
    if sum(N_array)%9 ==0:
        print('Yes')
    else:
        print('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:
a = input()
a = list(a)
ans = 0
for i in a:
    i =int(i)
    ans += i
if ans%9==0:
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
N = input()

n_list = list(N)

ans = 0

for k in n_list:
    ans += int(k)

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

Submission status: Accepted

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

a=sum(n)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

if N%9 == 0:
  ans = 'Yes'
else:
  ans = 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
L = len(N)
c = 0

for i in range(L):
    k = int(N[i])
    c = k + c

if c%9 == 0:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
n = input()

count = 0
for i in range(len(n)):
  num = int(n[i])
  count = count + num

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
i = input()

a = 0
for c in i:
    a += int(c)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())
sumN = 0

for i in range(len(N)):
  sumN += int(N[i])

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

Submission status: Accepted

Solution code:
n=str(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()
x = [int(i) for i in list(N)]
p = sum(x)
if p % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
if n == 0:
    print("Yes")
    exit()

mod = n%9

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=str(input())
sum=0
for c in n:
  sum+=int(c)
if sum%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[i])
if s % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
str = list(input())
str=[int(s) for s in str]
ans=0
for k in str:
    ans += k
if ans % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
li  =   lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw  =   lambda : sys.stdin.readline().strip().split()
ni  =   lambda : int(sys.stdin.readline().strip())
nsi =   lambda : sys.stdin.readline().strip()

from collections import defaultdict as df
import math
s=input()
sum=0
for i in s:
    sum+=int(i)

if(sum%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:
import sys
input = sys.stdin.readline
I = lambda : list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
N = input()
num=0
if int(N)%9 !=0:
  print('No')
else:
  for i in range(len(N)):
    num+=int(N[i])
  if num%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:
a = int(input())
s = str(a)
array = list(map(int, s))
if sum(array) % 9 ==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import math
x = input()
c = 0
for k in x:
  c += int(k)
if c % 9 ==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
l = [int(s) for s in list(N)]
ans = sum(l)

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in s:
    ans += int(i)
if ans % 9:
    print("No")
else:
    print("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:
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

N = int(input())

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

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 = int(input())
if( n % 9 == 0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_nine(x):
    res = 0
    while x > 0:
        t = x % 10
        res += t
        x //= 10
    return res

if __name__ == '__main__':
    N = list(input())
    e = 0
    for i in N:
        e += int(i)
        
    if (e % 9 == 0):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def digitSum(n):
    s = str(n)
    array = list(map(int, s))
    return sum(array)

N = int(input())
sum = digitSum(N)

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

Submission status: Accepted

Solution code:
N = input()
temp = 0

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

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

Submission status: Accepted

Solution code:
N = input()

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

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

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:
na=int(input())

def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

aha=digitSum(na)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = input()
eachSum = 0

for i in range(len(N)):
    eachSum += (int(N[i]) % 9)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

#N = int(input())
N =list(input())
#print(N)
cnt = 0
for i in range(len(N)):
  cnt += int(N[i])
  #print(N)

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

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0
for i in range(l):
  sum += int(N[i])
  
if sum%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=str(input())
k=0
while len(n)>=2:
  for i in n:
    k+=int(i)
    #print(k)
  n=str(k)
  k=0
if n=='9'or n=='0':
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
nine = [int(i) for i in N]
if sum(nine)%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 = list(map(int,list(input())))
sum = sum(n)
if sum%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

n = input()

total = 0

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = input()

sumAll = 0
for s in N:
    n = int(s)
    sumAll  += n

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

Submission status: Accepted

Solution code:
N = int(input())

result = N%9

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

Submission status: Accepted

Solution code:
import numpy as np
X = int(input())
S = str(X)
L=[int(i) for i in S]
Y=np.sum(L)
if Y%9==0:
    ans="Yes"
else:
    ans="No"

print(ans)

Submission status: Accepted

Solution code:
N = input()
l = [int(x) for x in list(N)]

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

str_ = input()
sum_ = sum([int(s) for s in str_[:-1]])
print('Yes' if sum_ % 9 == 0 else 'No')

Submission status: Accepted

Solution code:

import time

start_time = time.time()

n = str(input())

one = n.count('1')
two = n.count('2') * 2
three = n.count('3') * 3
four = n.count('4') * 4
five = n.count('5') * 5
six = n.count('6') * 6
seven = n.count('7') * 7
eight = n.count('8') * 8
nine = n.count('9') * 9

ans = one + two + three + four + five + six + seven + eight + nine

if ans % 9 == 0:
    print('Yes')
    # print("elapsed_time:{time} sec".format(time=time.time() - start_time))

else:
    print('No')
    # print("elapsed_time:{time} sec".format(time=time.time() - start_time))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
bool = False
n=0
for b in a:
  n += int(b)
if n % 9 == 0:
  bool = True
    
if bool==True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = input()
ans = []
print('Yes' if sum(map(int,list(N))) % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
inputs = int(input())

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

Submission status: Accepted

Solution code:
N = input()

sum = 0
for i in N:
    sum += int(i)


res = sum%9
if res==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():
    
    N = input()

    ans = 0

    for i in range(len(N)):
        ans += int(N[i])

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

sum_of_N = 0
for s in N:
    sum_of_N += int(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = input()
# n = list(n)

_sum = 0

for e in range(len(n)):
    _sum = _sum + int(n[e])

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

Submission status: Accepted

Solution code:
N=input()
# NN=[int(N[i]) for i in range(len(N))]
L=(len(N))
i,s=0,0

while i<L:
  s+=int(N[i])
  i+=1
  
if (s%9==0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
readline = stdin.readline

def main():
    N = readline().rstrip()
    ans = 0
    for n in N:
        ans += int(n)
    print('Yes' if ans % 9 == 0 or ans == 0 else 'No')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = input()
num = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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


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

Submission status: Accepted

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


def main():
    N_str = sys.stdin.readline().rstrip()

    sum_digit = 0

    for s in N_str:
        sum_digit += int(s)
    
    if (sum_digit % 9 == 0):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

# print(N)

if N==0:
    print('Yes')
    exit()

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

Submission status: Accepted

Solution code:
s=input()
sum1=0
for i in range(len(s)):
    sum1+=(ord(s[i])-48)
if sum1%9==0:
    print('Yes')
else:
    print("No")

Submission status: Accepted

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

total = sum(n)

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

Submission status: Accepted

Solution code:
x = input()
sum=0
for i in x:
  sum=sum+int(i)
if sum%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:
#x = int(input())
#A = list(map(int, input().split()))
#n, x, t = map(int, input().split())
n = input()
list_num = list(n)
list_num = [int(n) for n in list_num]
ans = sum(list_num)
#print(list_num)
if ans % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = input()

num = str(num)

list_num = list(num)

list_num = [int(s) for s in list_num]

ans = 0

for n in list_num:
    ans += n
    ans  = ans%9

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

sum = 0
for i in range(len(N)):
    sum = sum + int(N[i])

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int, input()))
s = sum(a)

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

Submission status: Accepted

Solution code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
###############################################################################\
s=input()
x=0
for i in s:
    x+=int(i)
if x%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
t = list((input()))
sum=0
for e in t:
    sum+=int(e)
if sum%9==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
A = list(input())
for n in range(len(A)):
    A[n] = int(A[n])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
def cal(a):
    nine = 0
    for i in range(len(a)):
        nine += int(a[i])
    return nine

print(['No',"Yes"][cal(N)%9==0])

Submission status: Accepted

Solution code:
import sys
import math

N = int(input())

n = str(N)

a = list(map(int,n))

n_sum = sum(a)

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

Submission status: Accepted

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

numList = []
result = []

user2 = input()
total = 0
for i in user2:
    total += int(i)

result = "No"
if 0 == total % 9:
    result = "Yes"

print(result)

Submission status: Accepted

Solution code:
n = int(input())

s = str(n)
s_l = list(map(int, s))
sum = sum(s_l)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n_str = str(input())
x = 0
for e in n_str:
    x += int(e)
print('Yes') if x % 9 == 0 else print('No')

Submission status: Accepted

Solution code:
n=list(input())
n=map(int,n)
if sum(n)%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()
a = 0
for i in n:
    a += int(i)
if a % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(map(int, input().split()))
sum_ = 0

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

Submission status: Accepted

Solution code:

n = list(str(input()))

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

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

Submission status: Accepted

Solution code:
def Qb():
    n = [int(v) for v in input()]
    ans = 'No'
    if sum(n) % 9 == 0:
        ans = 'Yes'
    print(ans)


if __name__ == '__main__':
    Qb()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
numlist = list(input())

n = 0
for num in numlist:
  n += int(num)
  n %= 9
if n == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
nli = []
for i in range(len(N)):
    nli.append(N[i])
print("No" if sum(map(int, nli)) % 9 else "Yes")

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 = int(input())
if N%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
import sys
#input = sys.stdin.readline  #文字列では使わない
N =input().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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