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

Solution (Python):
s = input()
sum = 0
for x in s:
    sum += int(x)

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

Solution (Python):
n=input()
al=len(n)
ans=0

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

Solution (Python):
N = int(input())
N2 = str(N)
a = list(N2)
s = 0
for i in a:
    s += int(i)
if s%9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
nstr=input()
keta=len(nstr)
wa=0
for i in range(keta):
    wa+=int(nstr[i])

ans="No"
if wa%9==0:
    ans="Yes"

print(ans)

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

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

Solution (Python):
def mult(n):
    res = 0 
    for i in n:
        res += int(i)

    if res%9 != 0:
        return "No"
    return "Yes"

n = input()
print(mult(n))

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

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

Solution (Python):
def multipleOf9(n)-> str:
  if (n % 9) == 0:
    return 'Yes'
  return 'No'

if __name__ == "__main__":
  num = list(map(int, input().split()))
  print(multipleOf9(num[0]))

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

Solution (Python):
N = input()
N_list = []
for i in N:
    N_list.append(int(i))

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

Solution (Python):
n=input()
t=len(n)
z=0
for i in range(t):
  
  z=z+int(n[i])

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

Solution (Python):
n = int(input())

d = 0
while True:
    d += n // 10
    n -= d*10

    if n < 10:
        d += n
        break

if not d % 9:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

 
N=int(input())

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

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

Solution (Python):
N = input()

s = 0
for d in N:
    s += ord(d) - ord('0')
if s % 9 == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = str(input())

count = 0
for v in list(n):
    count += int(v)

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

Solution (Python):
import sys
import math

n = str(sys.stdin.readlines()[0])

tot = 0
for dig in n[0:-1]:
    
    tot += int(dig)

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

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

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

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

Solution (Python):
import math

num = input()

l = len(num)

k = 0
for i in range(l):
    k += int(num[i])

ans = k % 9

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

else:
    print("No")

Solution (Python):
o = ['No','Yes']
f = 0
N = str(input())
p = sum(list(map(int,N)))
r = p % 9

if r == 0:
    f = 1
else:
    f = 0

print(o[f])

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

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

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

Solution (Python):
import numpy as np 

s_ = input()
s = np.array([int(s_[i]) for i in range(len(s_))])
k = 0
for n in s:
    k += n
if k % 9 ==0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
import sys, os.path

if(os.path.exists('input.txt')):
    sys.stdin = open('input.txt',"r")
    sys.stdout = open('output.txt',"w")

sys.setrecursionlimit(10 ** 5)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))

def solve():
    sum=0
    lst = list(input())
    for _ in range(len(lst)):
        sum+=int(lst[_])
    if sum%9==0:
        print("Yes")
    else:
        print("No")
solve()

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

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

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

Solution (Python):
n = input()
s = list(n)

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

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

Solution (Python):
s=sum(map(int,str(input())))

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

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

Solution (Python):
sn = input()

n = 0

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



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

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

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

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

Solution (Python):

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

Solution (Python):
print('YNeos'[sum(map(int,input().split()))%9!=0::2])

Solution (Python):
n = input()
total = sum(list(map(int, n)))
while True:
    if int(n) == 0:
        print('Yes')
        break
    if len(str(total)) != 1:
        total = sum(list(map(int, str(total))))
    elif total == 9:
        print('Yes')
        break
    else:
        print('No')
        break

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

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

Solution (Python):
N = input()
check = 0

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

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

Solution (Python):
n = int(input())

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

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

Solution (Python):
N = int (input ())









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

Solution (Python):

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

Solution (Python):

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

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

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

Solution (Python):
n = str(input())
s = []
for i in list(n):
    s.append(i)
t = list(map(int,s))
ans = sum(t)
if ans%9 == 0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
x = input().split()
sum = 0

for i in x:
    sum += int(i)

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

Solution (Python):
n = int(input())

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

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

Solution (Python):
a = str(input())
b = []
c = 0
for i in range(len(a)):
    b.append(int(a[i]))
if sum(b) % 9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = input()
s = 0
for i in range(0, len(n)):
    s += int(n[i])
ans = 'Yes' if s % 3 == 0 else 'No'
print(ans)

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

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

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

Solution (Python):

N = str(input())

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

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

Solution (Python):
def main():
    numList = list(map(int,input()))
    s = sum(numList)

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


if __name__ == "__main__":
    main()

Solution (Python):
import math
N = input()



array = list(map(int, N))

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

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

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

Solution (Python):
num_list = list(map(int, input().split()))

total = sum(num_list)

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

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

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

Solution (Python):
N = list(input())
A = 0

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

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

Solution (Python):
N = input()
ans = 0
for i in N:
    ans = (ans+int(i)) % 9
print("YNeos"[ans!=0::2])

Solution (Python):
inputStr = input()
array = [int(i) for i in inputStr]
sum = 0

for num in array:
    sum += num

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

Solution (Python):
def solve(string):
    return "Yes" if sum(map(int, list(string))) % 9 == 0 else "No"


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
N = input()

tmp = 0

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

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

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

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

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

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

Solution (Python):
n = int(input())

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

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

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

Solution (Python):


N = int(input())
count = 0

while N > 0:
    count += (N % (10 ** 100)) % 9
    N = N // (10 ** 100)

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

Solution (Python):
N = input()
check = 0

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

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

Solution (Python):
N = input()

if int(N) < 10:
    if int(N) == 9:
        print('Yes')
    elif int(N) == 0:
        print('Yes')
    else:
        print('No')
elif int(N) >= 10:
    l = [int(n) for n in list(N)]
    a = sum(l)
    if a % 9 == 0:
        print('Yes')
    else:
        print('No')

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

Solution (Python):
from math import ceil
def main():
    s=sum(map(int,input()))
    print('No' if s%9 else 'Yes')
main()

Solution (Python):
n = int(input())

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

Solution (Python):
n = input()

list = []

for i in range(len(n)):
    list.append(int(n[i]))


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

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

Solution (Python):
N = input()

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

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

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

Solution (Python):
str_n = input()
n = len(str_n)

cnt = 0
for i in range(n):
    cnt += int(str_n[i])

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

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

Solution (Python):
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from functools import lru_cache
import math


rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')
MOD = 10**9 + 7

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

if __name__ == "__main__":
	main()

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

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

Solution (Python):
n=int(input())
list1 = []
sum: int = 0
for i in str(n):
    list1.append(int(i))
    sum +=int(i)
print("Yes" if n % 9 == 0 and sum % 9 == 0 else "No")

Solution (Python):
N = int(input())

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

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

Solution (Python):
num = input()

intNum = 0

loop = len(num)
for i in range(loop):
  intNum += int(num[i])

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

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

Solution (Python):















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

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

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

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

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

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

Solution (Python):
N=list(input())

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

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

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

Solution (Python):
li = list(input())

sum_ = 0
for val in li:
  sum_ += int(val)
if sum_%9 == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
def main():
    N = str(input())
    M = list(map(int, N))
    S = sum(M)

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


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = str(input())
    M = list(map(int, N))
    S = sum(M)
   
    print('Yes') if S % 9 == 0 else print('No')


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = str(input())
    M = list(map(int, N))
    S = sum(M)
   
    print('Yes') if S % 9 == 0 else print('No')


if __name__ == '__main__':
    main()

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


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = int(input())
    sum = 0
    for digit in str(N):
        sum += int(digit)

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


if __name__ == '__main__':
    main()

Solution (Python):
num = int(input())
ans = num%9

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

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

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

Solution (Python):
N = input()
num_N = [int(i) for i in N]
total = sum(num_N)
if total%9 == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()

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

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

else:
    print('No')

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

Solution (Python):
n = input()
cnt = 0
for i in range(len(n)):
  cnt += int(n[i])
  cnt %= 9

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

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

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

Solution (Python):
N = str(input())
M = list(map(int, N))
S = sum(M)

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

Solution (Python):
N = int(input())

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

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

Solution (Python):
N = str(input())

a = sum([int(n) for n in list(N)])

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

Solution (Python):
N = str(input())

a = list(N)

result = 0

for x in a:
    x = int(x)
    result += x

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

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

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

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):
count=0
n=input()
k=len(n)
for i in range(k):
    count+=int(n[i])

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

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

Solution (Python):
n = input()

x = 0

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

Solution (Python):
l = list(map(int,input()))
x = sum(l)
if not x%9:
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
n = int(input())

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

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

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

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

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

Solution (Python):
import numpy as np
N=int(input())

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

Solution (Python):
print('YNeos'[sum(map(int,input()))%9!=0::2])

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

Solution (Python):
n = input()
s = sum([int(nn) for nn in n.split()])
print('Yes' if s % 9 == 0 else 'No')

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

Solution (Python):
def solve(n):
    sum = 0
    for i in n:
        sum += int(i)
    if sum % 9 == 0:
        return "Yes"
    else:
        return "No"

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

Solution (Python):
N = input().rstrip()
v = 0
for c in N:
	if c == '9':
		continue

	v += int(c)

num = int(v / 9)
r = 'Yes' if v == num * 9 else 'No'
print(r)

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

Solution (Python):
N = input()

ans = 0

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

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

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

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

Solution (Python):
N = input()
l = len(N)
sum = 0
for i in range(l):
    sum += int(N[i])
    sum %=9

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

Solution (Python):
N = input()
dig_sum = 0
for n in N:
    dig_sum += int(n)

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

Solution (Python):
n = input()
m = [int(s) for s in list(n)]

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

Solution (Python):
n = str(input())
sum = 0

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

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

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

Solution (Python):
N = list(input())
c = 0

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

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

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

Solution (Python):
import math
n = int(input())

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

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

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

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

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

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

Solution (Python):

number = input()

result = 0
for char in number: 
    result += int(char)

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

Solution (Python):
def main():
    s = input()
    sm = 0
    for c in s:
        sm += int(c)
    if sm % 9 == 0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

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

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

Solution (Python):
n=int(input())
print('No' if n % 3 else 'Yes')

Solution (Python):
N = list(map(int,input()))
M = 0
for i in range(len(N)):
    M += N[i]
if M % 9 == 0:
    print('Yes')
else:
    print('No')

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

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

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

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

Solution (Python):
n = str(input())
lenn = len(n)

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

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

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Solution (Python):
n = int(input())

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

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

Solution (Python):
N = input()

sum = 0
if int(N) != 0:
    data_size = len(N)
    for data_size in range(data_size):
        sum += int(N[data_size])

else:
    sum = 0

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

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

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

Solution (Python):
n=input()

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

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

Solution (Python):

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

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

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

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

Solution (Python):

N=map(int,list(input()))
Total=sum(N)

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

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

Solution (Python):
N=map(int,list(input()))
Total=0
for n in N:
  Total+=n

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

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

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

Solution (Python):
N = int(input())
d = N % 9
s = sum(list(map(lambda x: int(x), list(str(N))))) % 9

if d == 0 and s == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = int(input())
div = N % 9
s = sum(list(map(lambda x: int(x), list(str(N))))) % 9

if div == 0 and s == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = list(input())

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

Solution (Python):
line = input()
N = int(line)

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

Solution (Python):
from __future__ import division, print_function






from sys import stdin, stdout
import bisect            
import math
import heapq
i_m=9223372036854775807
def inin():
    return int(input())
def stin():
    return input()
def spin():
    return map(int,stin().split())
def lin():                           
    return list(map(int,stin().split()))
def matrix(n):
    
    return [list(map(int,input().split()))for i in range(n)]


def calculate_sum(a, N): 
    
    m = N / a 
    
    sum = m * (m + 1) / 2
    
    ans = a * sum
    return ans
def series(N):
    return (N*(N+1))//2

def count2Dmatrix(i,list):
    return sum(c.count(i) for c in list)

def modinv(n,p):
    return pow(n,p-2,p)

def GCD(x, y): 
    x=abs(x)
    y=abs(y)
    if(min(x,y)==0):
        return max(x,y)
    while(y): 
        x, y = y, x % y 
    return x
def LCM (x, y):
    return (x * y) // GCD(x, y)
    
def Divisors(n) : 
    l = []  
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) : 
            if (n // i == i) : 
                l.append(i) 
            else : 
                l.append(i)
                l.append(n//i)
    return l
def isprime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True
prime=[]
def SieveOfEratosthenes(n): 
    global prime
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p): 
                prime[i] = False
        p += 1
    f=[]
    for p in range(2, n): 
        if prime[p]: 
            f.append(p)
    return f
q=[]       
def dfs(n,d,v,c):
    global q
    v[n]=1
    x=d[n]
    q.append(n)
    j=c
    for i in x:
        if i not in v:
            f=dfs(i,d,v,c+1)
            j=max(j,f)
            
    return j

 
"""*******************************************************"""
n = (list(input()))
n = map(int, n)

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

Solution (Python):
N = input()

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

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

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

Solution (Python):
n = int(input())

def checkMult9(m):
	ms = str(m)
	if len(ms) > 2:
		s = 0
		for letter in ms:
			s += int(letter)
		return checkMult9(s)
	return m%9 == 0

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

Solution (Python):

import math

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

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

Solution (Python):
n=input()
ls=[]
for i in n:
    ls.append(int(i))
if sum(ls)%9==0:
  print("Yes")
else:
  print("No")

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

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

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

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

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

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

Solution (Python):

import sys
import numpy as np
import time




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

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

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

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

Solution (Python):
n = list(map(int,input().split()))

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

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