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:
# input here
_INPUT = """\
123456789
"""

def main():
    n = [int(i) for i in input()]

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


if __name__ == '__main__':
    import io
    import sys
    import math
    import itertools

    # sys.stdin = io.StringIO(_INPUT)
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
total = 0
if int(n) >= 0 and int(n) < 10**200000:
    for i in n:
        total = total + int(i)
    if total % 9 == 0:
        print("Yes")
    else:
        print("No")
else:
    print()

Submission status: Accepted

Solution code:
N = input()
digits = list(N)

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

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

Submission status: Accepted

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

if s%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()) # list()でリスト化、それを変数に代入。
if n == 0:
    print('Yes')
    exit()
while(True):
    n = digitSum(n)
    if len(str(n))==1:
        if n == 9:
            print('Yes')
        else:
            print('No')
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ｎum = int(input())

s = str(num)
array = list(map(int, s))
f = sum(array)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_multiple_of_nine(x):
    cnt = 0
    for c in str(x):
        cnt += int(c)
    return (cnt % 9) == 0
    
x = int(input())

if is_multiple_of_nine(x):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())


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

def main():
    N = I()
    dig_sum = digitSum(N)
    print("Yes" if dig_sum%9==0 else "No")

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#B
N=list(input())
for i in range(len(N)):
    N[i]=int(N[i])

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

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

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

Submission status: Accepted

Solution code:
N=list(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()
judge = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def abc176_b():
    # 各桁を加算した値を格納
    _n = sum(map(int, list(input())))
    if _n % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    abc176_b()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

num = [int(n[i]) for i in range(len(n))]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from sys import stdin,stdout
import math
import time
from functools import lru_cache
from collections import Counter
import heapq
#@lru_cache(maxsize=None) #for optimizing the execution time of callable objects/functions(placed above callable functions)
try:
    for _ in range(1):
        N=int(input())
        if N%9==0:
            print("Yes")
        else:
            print("No")
except EOFError as e:
    print(e)

Submission status: Accepted

Solution code:
S = input()

while len(S) > 10:
    _sum = 0
    for n in S:
        _sum += int(n)
    S = str(_sum)

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

Submission status: Accepted

Solution code:
import sys
input=lambda :sys.stdin.readline().rstrip()

ans = 0
for s in input():
  ans += int(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
if N==0:
    print("Yes")
elif 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:

##main#######################################

## INPUT ####################################
N=input()
NN=list(N)

## PROCESSING ###############################
num=0
for s in NN:
	num=num+int(s)

## OUTPUT ###################################
if num % 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:
#from functools import lru_cache
import sys
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

n=reader()[0][0]
i=vfunc(lambda n:int(n))(n)
print('Yes' if sum(i)%9==0 else 'No')

Submission status: Accepted

Solution code:
N = input()

buf = 0
for x in range(0, len(N)):
    buf += int(N[x])
    if buf % 9 == 0:
        buf = 0


print("Yes" if buf == 0 else "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 = list(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())
result= sum(list(map(int, str(n))))
if result % 9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import math

num = input()
total = 0
num2 = list(num)
num_list = list(map(int, num2))
sum = sum(num_list)
if sum % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input().rstrip()
#N = list(str(10**20000))
sum0 = 0

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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:
X = input()
s = 0

for x in X:
    s = s + int(x)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solution(inp: str) -> str:
    total: int = 0
    for n in inp:
        total += int(n)
    if total % 9 == 0:
        return "Yes"
    else:
        return "No"


inp: str = str(input())
print(solution(inp))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys 
def get_string(): return sys.stdin.readline().strip() 
  
string = get_string()
s=0
while string!='':
    s=s+int(string[-1])
    string=string[:-1]
if s%9==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = list(input().rstrip())
    print(["No", "Yes"][sum(map(int, n))%9==0])
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
a = input()

answer = 0

for i, val in enumerate(a):
	answer = (answer+int(val))%9

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

Submission status: Accepted

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

for n in listN:
  newn =int(n)
  sumN += newn
  
if(sumN%9 == 0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
numbers = input().split()
total = sum([int(number) for number in numbers])
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")

Submission status: Accepted

Solution code:
N = int(input())

while N >= 10:
  s = str(N)
  array = list(map(int, s))
  N = sum(array)

if N == 9 or 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 = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

Solution code:
N = int(input())
N_str = str(N)

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


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

s = str(n)
array = list(map(int, s))
if sum(array) % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

s = input()
sum = 0
for i in s:
    sum += int(i)
    sum = sum % 9

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3


def solve(num):
    res = 0
    for x in num:
        dig = int(x)
        res = (res + dig) % 9

    if res == 0: return "Yes"
    return "No"


if __name__ == "__main__":
    num = input()
    print(solve(num))

Submission status: Accepted

Solution code:
def multiple_9(num):
    res = 0
    for s in num:
        res += int(s)
    return res % 9 == 0

def start():
    nums = input()
    if multiple_9(nums):
        print("Yes")
    else:
        print("No")
start()

Submission status: Accepted

Solution code:
import sys
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda: list(map(int, input().strip().split()))

MOD = 10**9 + 7


def main():
	# ans_ = []
	# ans_.append(ans)
	# print(("\n").join(map(str, ans_)))
	n = input().strip()#10**200000 - 1#int(input())
	i = 0
	s = 0
	while i < len(n):
		# print(n)
		s += int(n[i])
		s %= 9
		i += 1
	print("YNeos"[s!=0::2])






if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
#!/usr/bin/python

from sys import stdin
from keyword import iskeyword

if __name__ == "__main__":
    n = int(input())
    if n % 9 == 0:
        ret = "Yes"
    else:
        ret = "No"
    print(ret)

Submission status: Accepted

Solution code:
a=int(input())

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

Submission status: Accepted

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



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

Submission status: Accepted

Solution code:
n = input()

s = sum([int(v) for v in n.split()])

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

Submission status: Accepted

Solution code:
N = input()

hantei = 0

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
total = list(str(N))
ntotal = 0
for i in range(len(total)):
  ntotal += int(total[i])
#print(ntotal,ntotal % 9)
if ntotal % 9 == 0 or ntotal == 0:
  print("Yes")
else:
  print("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:
N =input()
array = list(map(int, N))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# t=int(input())
# for _ in range(t):
#     n=int(input())
#     arr=[int(x) for x in input().split()]
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_arr = [int(n[i]) for i in range(len(n))]
tmp = 0
for i in n_arr:
    tmp += i
if tmp % 9 == 0:
    ans = 'Yes'
else:
    ans ='No'
print(ans)

Submission status: Accepted

Solution code:
def probB():
    N = input()
    n = 0

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

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


def main():
    probB()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = []
n = list(map(int, input().split()))
cnt = 0
for i in range(len(n)):
    cnt += n[i]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def add_each_number(num):
  s = str(num)
  array = list(map(int, s))
  return sum(array)
 
num = input()
while len(str(num)) > 1:
  num = add_each_number(num)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = str(input())
sum = 0
for num in a:
  sum += int(num)
if sum % 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:
#!/usr/bin/env python

def f(n: str) -> str:
    """
    >>> f("1")
    'No'
    >>> f("8")
    'No'
    >>> f("9")
    'Yes'
    >>> f("123456789")
    'Yes'
    >>> f("0")
    'Yes'
    >>> f("31415926535897932384626433832795028841971693993751058209749445923078164062862089986280")
    'No'
    """
    n_sum = 0
    for index in range(0, len(n)):
        n_sum += int(n[index])
    return 'Yes' if n_sum % 9 == 0 else 'No'


if __name__ == '__main__':
    n = input()
    print(f(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input("")
k = []
for i in range(len(N)):
    k.append(N[i])
k = [int(i) for i in k]
if sum(k) % 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 digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

x = int(input())

L = digitSum(x)

if L % 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(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()
L = len(N)
S = 0
for i in range(L):
    S += int(N[i])

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

Submission status: Accepted

Solution code:
n = input()
nlist = list(n)
l = len(nlist)
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
# print(x)
# print(len(x),x[0])
sum = 0
for i in range(len(x)):
    sum = sum + int(x[i])

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

Submission status: Accepted

Solution code:
a=input()
b=0
kei=0
while(b!=len(a)):
    kei+=int(a[b])
    b+=1
if(kei%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:
input_num = int(input())

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
n = list(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=list(input())
n= list(map(int,input()))

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

Submission status: Accepted

Solution code:
import numpy as np
import math
strN = input()
splN = list(strN)
intN = [int(s) for s in splN]
sumN = sum(intN)
if sumN % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
s = 0
for a in n:
    s += int(a)

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

Submission status: Accepted

Solution code:
str_line = input().split()
num_line = [int(n) for n in str_line]

sum_reslt=0

for i in range(len(num_line)):
    sum_reslt += num_line[i]
    
if sum_reslt % 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)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp=input()
x=0

for i in range(len(inp)):
    x+=int(inp[i])

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

#print(cou)

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

else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
N = input()
ar = list(map(int, N))
ans = sum(ar)

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

Submission status: Accepted

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

sum = 0
for i in N:
    sum += i

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

Submission status: Accepted

Solution code:
N = input()

total = 0
for i in range(10):
  count = str(N).count(str(i))
  total += int(i) * int(count)

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

Submission status: Accepted

Solution code:
N = str(input())

result = sum(list(map(int, N)))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def MultipleOf9():
    
    num = str(input())

    count = 0

    for i in range(len(num)):
        
        count = count + int(num[i])
        
    if count % 9 == 0:
        print('Yes')
        
    else:
        print('No')
        
if __name__ == '__main__':
    MultipleOf9()

Submission status: Accepted

Solution code:
n = int(input())

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

x = result % 9

if x == 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 run(x):
    '''

    '''


    # sum = 0
    # while x > 0:
    #     sum += x%10
    #     x = int(x/10)

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


if __name__ == '__main__':
    x = int(input())
    run(x)

Submission status: Accepted

Solution code:
s=input()
l=[]
sm=0
arr=["0","1","2","3","4","5","6","7","8","9"]
for i in range(0,10):
  l.append(s.count(arr[i]))
for i in range(0,10):
    a=int(l[i])
    sm=sm+(a*i)
if sm%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 = 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()



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:
def ans(n): 

    aa = 0
    for i in n:
        aa+=int(i)
    return True if aa%9==0 else False
        
  
n = input()

print('Yes' if ans(n) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def actual(n):
    digit_sum = sum(map(int, str(n)))

    if digit_sum % 9 == 0:
        return 'Yes'

    return 'No'

n = int(input())
print(actual(n))