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):
myList = input()
sum = 0
for i in myList:
    sum+=int(i)
print(("Yes","No")[sum%9!=0])

Solution (Python):
def multiple9(N):
    sN = str(N)
    sum = 0
    for i in range(len(sN)):
        sum += int(sN[i])
    if sum % 9 == 0:
        return 'Yes'
    else:
        return 'No'

if __name__ == "__main__":
    N = int(input())
    print(multiple9(N))

Solution (Python):
a = input()
b = len(a)
c = 0

for i in range(b):
  c += int(a[i])
  
d = c % 9

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

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

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()
total = sum(list(map(int, list(n))))

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

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

Solution (Python):


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

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

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

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

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

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

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

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

Solution (Python):
import sys
import math
def Ii():return int(sys.stdin.readline().rstrip())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))

s = sys.stdin.readline().rstrip()
ans = 0
for i in s:
	ans += int(i)
	ans %= 9

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

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

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

Solution (Python):
s = input()

tmp = 0

for c in s:
	tmp+=int(c)
	tmp-=int('0')

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

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

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

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

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

Solution (Python):
s = input()
res = 0
for x in s:
    res += int(x)
if res %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()
a=0
for i in range(len(n)):
    a+=int(n[i])
if a%9==0:
    print("Yes")
else:
    print("No")

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

while len(N)>1:
    x = 0
    for i in range(len(N)):
        x += int(N[i])
    N = str(x)
if int(N)%9 == 0:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):

import math as M

num = input()
sum = 0
for ch in num :
    sum += ord(ch)-ord('0')
if sum%9==0 :
    print('Yes')
else :
    print('No')
exit()      

n,x,t = (map(int,input().split()))
print(t*(n//x) + t*(min(n%x,1)))
exit()

n = int(input())
a = list(map(int,input().split()))
cm = 1000
p1 = p2 = a[0]
for i in range(1,n):
    
    if(a[i]>=p2):
        p2 = a[i]
    elif(a[i]<p2):
        cm += (cm//p1)*(p2-p1)
        p1 = p2 = a[i]
cm += (cm//p1)*(p2-p1)
print(cm)
exit()

cm = 1000
for i in range(0,40):
    st = cm//100
    cm -= st*100
    cm += st*200
print(cm)
print(M.log10(cm))
print(M.log2(10**16))
exit()

isPrime = [1]*101
isPrime[0]=isPrime[1]=0
for i in range(2,int(M.sqrt(101)+1)) :
    if not isPrime[i] : continue
    for j in range(i*i,101,i) :
        isPrime[j]=0

pa = 5
pb = 1
ctr= 0
for i in range(2,101) : 
    if not isPrime[i] : continue
    if i==5 : 
        ctr+=1
        continue
    if(ctr&1) : 
        pa *= i
    else : 
        pb *= i
    ctr+=1
print(pa,' ',pa<=2*(10**18))
print(pb,' ',pb<=2*(10**18))

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


if __name__ == "__main__":
    main()

Solution (Python):


n = input()
n = list(n)

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

if s % 9 == 0:
    print('Yes')
else:
    print('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=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):
import sys

import math
def gcd(a,b):
	if a == 0:
		return b
	return gcd(b%a,a)

def solve(n):
	return n%9

def main():
	n = int(input())
	res = solve(n)
	if res == 0:
		print("Yes")
	else:
		print("No")
if __name__ == "__main__":
	main()

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

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

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

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

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
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())
N = I()
if N % 9 == 0:
    print('Yes')
else:
    print('No')

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

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

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

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

l=list(map(int,str(n)))

a=sum(l)

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

Solution (Python):
N = input()
total = 0
for i in N:
    total += int(i)

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

Solution (Python):
N = input()
total = 0
for i in N:
    total += int(i)

if total % 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())
a = [int(x) for x in n]
if sum(a) % 9 == 0:
  print('Yes')
else:
  print('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):
N = input()
length = len(N)

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

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

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

Solution (Python):


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

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

    return N


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

    Args:\n
        n (int): 整数

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


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

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

    
    print(ans)


if __name__ == "__main__":
    
    N = get_input()

    
    main(N)

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

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

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

Solution (Python):
S = input()
su = 0
for c in S:
  su += int(c)
print('Yes' if su%9==0 else '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):
A = list(input())
B = [int(a) for a in A]
if sum(B)%9 == 0:
    print('Yes')
else:
    print('No')

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

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

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

    print(ans)


if __name__ == "__main__":
    main()

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

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

Solution (Python):
n = input()

if sum([int(i) for i in 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=int(input())
print('No' if n % 9 else 'Yes')

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

Solution (Python):
x = input()

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

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

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

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

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

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

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

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

Solution (Python):
import numpy as np

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

Solution (Python):
import math

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

def main():
    N = input()
    
    
    if keta(N) % 9 == 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
a = int(input())
N = [int(x) for x in list(str(a))]

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

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

nine_mod = 0

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

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

Solution (Python):
n=input()

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

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

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

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

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

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

Solution (Python):

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

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

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

ans = 0
for i in n:
    ans = (ans + i) % 3
print('Yes' if ans % 9 == 0 else '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 = input()
N_sum = sum([int(i) for i in N])
if N_sum % 9 == 0:
    print("Yes")
else:
    print("No")

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

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

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

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

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

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

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

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

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

Solution (Python):

def main():
    import sys
    imput = sys.stdin.readline
    
    
    
    n = str(input())

    
    l = len(n)

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

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

    
if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
n = input()

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

print(tako(n))

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

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

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

else:
  print("No")

Solution (Python):
n_li = list(input())
judge = sum(map(int,n_li))
if judge%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()
S = 0
for i in N:
  S+=int(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):
n = int(input())

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

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

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

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

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

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

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):
def INT():
    return int(input())

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

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

N = LI()

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

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

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

Solution (Python):
n = int(input())
a = n % 9
if a == 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):
def solve(ns):
    d = 0
    for s in ns:
        d += int(s)
        d %= 9
    if d == 0:
        return 'Yes'
    else:
        return 'No'


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


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


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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


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


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

if __name__ == '__main__':
    main()

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

Solution (Python):




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


if __name__ == "__main__":
    main()

Solution (Python):
n = input()
array = list(map(int,n))
sumarray = sum(array)
if sumarray%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()
ans = 0
for moji in N:
    ans += int(moji)

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

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

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

Solution (Python):
a = input()

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys


N = input()
digits = 0

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

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

Solution (Python):
n = input()

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

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

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

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

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

Solution (Python):
n = input()

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

Solution (Python):
N = input()
sum_ = sum(map(int, N))
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):
n = int(input())

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

Solution (Python):
print('YNeos'[int(input())%9>0::2])

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

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):
num= input()
eq=0
for x in range(len(num)):
    eq+=int(num[x])
   
if eq%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())
sum_N = 0
for i in range(len(N)):
    sum_N += int(N[i])

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

Solution (Python):
n = input()

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

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

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

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

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

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

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

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

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

Solution (Python):
l=list(map(int,list(input())))
s=sum(l)
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

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

if __name__=="__main__":
  main()

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

Solution (Python):
n = input()

N = 0

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

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

else :
    print("No")

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

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

Solution (Python):
N = input()
 
ans = sum(map(int, N))
 
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):
s=input()
arr=[int(item) for item in s]
if sum(arr)%9==0:
  print ('Yes')
else:
  print ('No')

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

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



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

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

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


if __name__ == '__main__':
    main()

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

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()
N_list = list(N)
N_list = [int(i) for i in N_list]
Sum = sum(N_list)
if Sum % 9 == 0:
    print('Yes')
else:
    print('No')

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

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

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

Solution (Python):
N = input()

sum = 0

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

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

print(ans)

Solution (Python):
N = input()

ans = sum(map(int, N))

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

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

if(cnt%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()
s=0
for x in n:
	s=(s+(ord(x)-48))%9
if (s%9==0):
	print("Yes")
else:
	print("No")

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

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

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

Solution (Python):
n = input()

s = len(n)

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

else:
  print('No')

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

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

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

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

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

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

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

Solution (Python):
N=input()

s=0
for c in N:
    s+=int(c)
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 = map(int, list(input()))

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

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

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

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 = 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):
import sys

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


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


if __name__ == '__main__':
    solve()

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

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

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

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

Solution (Python):
str_n = input().rstrip()
cnt = 0
for c in str_n:
  cnt += int(c)
if cnt%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()

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

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

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