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 = input()
sum_of_digits = 0
for d in n:
    sum_of_digits += int(d)
print('Yes' if sum_of_digits%9 == 0 else 'No')

Submission status: Accepted

Solution code:
N=int(input())
S=str(N)
A=len(S)
M=0
for i in range(A):
  M=M+int(S[i])
if M%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()
li = list(s)

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

Submission status: Accepted

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

num = list(N)
su = 0


for i in num:
    su += i

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

tmp = 0

#for i in range(len(str(n))-1):
#    tmp += n[i]

if n % 9 == 0:
#    if sum % 9 == 0:
#        print("Yes")
#    else:
    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:
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

n = inp()
m = int(n)

ans = 0

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

ans %= 9

if ans == 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()

result = 0
for c in N:
    result += int(c)
    result = (result % 9) if result > 9 else result

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

Submission status: Accepted

Solution code:
n = input()
order_sum = 0

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

if order_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())
result = 'Yes' if N % 9 == 0 else 'No'
print(result)

Submission status: Accepted

Solution code:
def main():
    A = list(input())
    s = 0
    for a in A:
        s += int(a)
    if s % 9 == 0:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

Solution code:
N = input()
USA = 0
n = 0
h = 0
k = 0
for i in range(0,len(N)):
    n += int(N[i])
if n % 9 == 0:
    print("Yes")
else:
    print("No")
    # h += 1
    # n += h
    # # if n == N+1:
    #     if n % 9 == 0:

Submission status: Accepted

Solution code:
n = list(input())

ans = 0
for i in n:
    ans += int(i)
    ans = ans%9

print('Yes' if ans == 0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
n = list(n)

n = map(int,n)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

if(N % 9 == 0):
	ans = True
else:
	ans = False



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
strn = list(input())
intn = []
for i in strn:
    intn.append(int(i))

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

Submission status: Accepted

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

Submission status: Accepted

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

n_sum = sum(n)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = input()
    acc = 0
    for idx in range(len(N)):
        acc += (ord(N[idx]) - ord('0'))

    print('Yes') if not acc % 9 else print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
tmp = 0
for s in N:
    tmp += int(s)
if tmp%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:
def main():
    if sum(list(map(int, list(input())))) % 9:
        print("No")
    else:
        print("Yes")


main()

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 = int(input())
l = list(map(int, list(str(n))))
# print(l)
# print(sum(l))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=input()
LN=len(N)
cnt=0
for i in range(LN):
  cnt+=int(N[i])
if cnt%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
N = list(map(int,list(input())))

sN = sum(N)

if sN%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 = int(input())

N_letter = str(N)
M = (len(N_letter))
S = 0
for i in range(M):
	S = S + int(N_letter[i])

if (S/9) ==  int(S/9):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())
N_str=str(N)
K=(len(str(N)))
S=0
for i in range(K):
  S += int(N_str[i])

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

Submission status: Accepted

Solution code:
def main():
    n = input()
    res = 0
    for ni in n:
        res = (res + int(ni)) % 9

    print(('Yes', 'No')[res != 0])


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main(int(input()))

Submission status: Accepted

Solution code:
print(('Yes','No')[sum(map(int,input()))%9>0])

Submission status: Accepted

Solution code:
# B - Multiple of 9

n = input()
print('Yes' if sum(int(d) for d in n) % 9 == 0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=str(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()
m = 0
for i in range(len(n)):
  m += int(n[i])
  m %= 9
  
if m == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
num = input()
lst = []
for x in num:
    lst.append(int(x))

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0
for ch in S:
  cnt += int(ch)
  
if cnt % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()
len_N = len(N)
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:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    S = input()
    n = 0
    for s in S:
        n += int(s)
    if n%9 == 0:
        print("Yes")
    else:
        print("No")


if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
N = input()
total = 0
for x in N:
    total += int(x)
if total%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 = input()

ret = 0

for s in n:
    ret *= 10
    ret %= 9
    ret += int(s)
    ret %= 9

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

Submission status: Accepted

Solution code:
n=input()
k=0
for m in n:
  k += int(m) % 9
print("Yes" if k % 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:
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 = int(input())

if n%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:
N= int(input())

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

Submission status: Accepted

Solution code:
N = 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:
num = list(input().split())

s = 0
for n in num:
  n = int(n)
  s += n

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

Submission status: Accepted

Solution code:
number = list(input())
sum = 0
for i in number:
    sum += int(i)
if (sum % 9) == 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:
'''

                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.

'''

ip=list(input())
sum=0
for i in ip:
    sum+=int(i)
if sum%9==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# 176 B
N = int(input())
    
print('Yes') if N % 9 == 0 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:
from sys import stdin
from math import ceil
inp = lambda : stdin.readline().strip()

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
inp = lambda : stdin.readline().strip()

a = list(inp())
a2 = [int(x) for x in a]
if sum(a2) % 9 == 0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
n = str(N)
a = list(n)

count = 0

for i in range(len(a)):
  count = count + int(a[i])

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

Submission status: Accepted

Solution code:
N = input()

Sum = 0
for n in list(N):
    Sum = Sum + int(n)

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

Submission status: Accepted

Solution code:
N = str(input())

tmp=0
for i in range(len(N)):
	tmp += int(N[i])
if tmp%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:
N = int(input())
if N % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
num = input()

ans = 0

for digit in num:
    ans += int(digit)

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

else:
    print("No")

Submission status: Accepted

Solution code:
lst = list(map(int,input().split()))

S = sum(lst)

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

Submission status: Accepted

Solution code:
d = input()

s = 0

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

Submission status: Accepted

Solution code:
n=input()

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

if tmp % 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])
    ans %= 9
print("Yes" if ans % 9 == 0 else "No")

Submission status: Accepted

Solution code:
def solve(s):
  suma = 0
  for x in s:
    suma += int(x)
  if suma % 9 == 0:
    return True
  return False

s = input()
x = solve(s)
if x == True: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
N = input()
lenN = len(N)
sumN = 0

for x in N:
    sumN += int(x)
    if sumN > 9:
        sumN %= 9
if sumN % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=str(input())
SUM=0

for i in range(len(K)):
  SUM+=int(K[i])

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

Submission status: Accepted

Solution code:
N = input()
s = len(N)
sum = 0

for i in range(s):
  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 range(len(N)):
    sum = sum + int(N[i])
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])
print('No'if s%9 else'Yes')

Submission status: Accepted

Solution code:
def func(N):
  strN = str(N)
  sum = 0
  for s in strN:
    sum += int(s)
  return "Yes" if sum % 9 == 0 else "No"

if __name__ == "__main__":
  N = str(input())
  print(func(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

strN = input()
s = 0
for c in strN:
  s += int(c)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def sum_i(N):
    return sum(list(int(i) for i in str(N)))


print("No") if sum_i(input()) % 9 else print("Yes")

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=list(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()
ans=0
for i in range(len(n)):
    ans+=int(n[i])
if ans%9:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#9の倍数
n = input()
s = list(n)
ss = [int(i) for i in s]
if sum(ss)%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()
total = 0
for i in range(len(n)):
    total += int(n[i])
ans = "Yes" if total % 9 == 0 else "No"
print(ans)

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N_sum = sum(N)

if N_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:
V = input()
s = 0
for c in V:
  n = int(c)
  s = s + n
  
if s%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
nums = []

for num in N:
    nums.append(int(num))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''
Problem Link - https://atcoder.jp/contests/abc176/tasks/abc176_b
'''
from sys import stdin,stdout
from math import *
from collections import *

mod = 1000000007

def gcd(a,b):
	while b:
		a,b = b,a%b
	return a

def lcm(a,b): return (a*b) // gcd(a,b)

def set_bits(X):
	c = 0
	while X:
		X &= (X-1);c += 1
	return c

def compute_MOD(N,M): return (N%M + M) % M

def get_array(): return list(map(int, stdin.readline().split()))
 
def get_ints(): return map(int, stdin.readline().split())

def get_int(): return int(stdin.readline())

def get_input(): return stdin.readline().strip()

def main():
	N = get_input()
	Sum = 0
	for i in N:Sum+=int(i)
	if Sum%9==0:stdout.write('Yes\n')
	else:stdout.write('No\n')
	

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

S = sum(int(d) for d in N)

print("Yes" if S % 9 == 0 else "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:
#!/usr/bin/env python3

N = int(input().split()[0])
ans = "Yes" if sum([int(i) for i in list(str(N))]) % 9 == 0 else "No"

print(ans)

Submission status: Accepted

Solution code:
# B - Multiple of 9

N = str(input())

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

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

Submission status: Accepted

Solution code:
def main():
    n = input()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import numpy as np
from math import ceil as C, floor as F, sqrt
from collections import defaultdict as D, Counter as CNT
from functools import reduce as R
import heapq as HQ

class Heap:
  def __init__(self, data, reverse=False):
    self.reverse = -1 if reverse else 1
    self.data = [self.reverse * d for d in data]
    HQ.heapify(self.data)
  def push(self, x): return HQ.heappush(self.data, self.reverse * x)
  def pop(self): return self.reverse * HQ.heappop(self.data)

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def Ss(): return list(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

n = S()
ans = 0
for x in n:
    ans += int(x)
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 = list(map(int, input().split()))
result = "Yes" if sum(n) % 9 == 0 else "No"
print(result)

Submission status: Accepted

Solution code:
#
# author Sidratul
#

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

Submission status: Accepted

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

while len(n) > 1: 
  tmp = sum(n)
  n = list(map(int, list(str(tmp))))

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

Submission status: Accepted

Solution code:
s = input()
acm = 0

for i in s:
    acm = (acm + ord(i)-ord('0'))%9

if(acm):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
input_ = input()
sum_ = 0
for i in input_:
  sum_ += int(i)
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:
from functools import reduce
print('Yes') if reduce(lambda x, y: x + y, map(int, list(input()))) % 9 == 0 else print('No')

Submission status: Accepted

Solution code:
S = input()
acc = 0
for ch in S:
  acc += int(ch)
print('Yes' if acc % 9 == 0 else '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())
def digitSum(n):
    s = str(n)
    array = list(map(int, s))
    return sum(array)
if digitSum(N) % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(map(int,input()))
if sum(n)/9 == sum(n)//9:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
n = int(input())
n_s = str(n)
m = 0
for i in range(len(n_s)):
    m += int(n_s[i])
    m = m % 9

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

Submission status: Accepted

Solution code:
s = input()
q = []
for i in s:
  q.append(int(i))
if sum(q)%9 == 0:
  print('Yes')
else:print('No')

Submission status: Accepted

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