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

Solution (Python):

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

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

Solution (Python):
listA=list(map(ｓｔｒ,input()))
sum=0
for i in range(len(listA)):
  sum=sum+int(listA[i])
  
if sum%9==0:
  print("Yes")

else:
  print("No")

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

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

Solution (Python):
import math


def main():
    n = input()
    ans = 0
    for i in n:
        ans += int(i)
    if ans % 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):
import sys
input = sys.stdin.readline

num = int(input())

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

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

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

result = 'Yes' if count % 9 == 0 else 'No'

print(result)

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


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

Solution (Python):
import numpy as np
num = list(map(int,(list(input()))))

ans = np.sum(num)

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

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

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

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

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

Solution (Python):
N = input()

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):
N = input()
result = 0
for c in N:
    result = (int(c) + result) % 9

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

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

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

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

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

Solution (Python):
a = list(map(int, list(input())))
b = sum(a)

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

Solution (Python):
def main():
    import sys
    def input():
        return sys.stdin.readline()[:-1]
    N=str(input())
    sum1=0
    for i in N:
        sum1 += int(i)
    
    if sum1%9 ==0:
        print("Yes")
        sys.exit()
    print("No")

if __name__ == '__main__':
    main()

Solution (Python):
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N = II()
    Nstr = str(N)
    Nsl = list(Nstr)
    ans = 0

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

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

if __name__ == "__main__":
	main()

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

Solution (Python):
import collections

def solution(n):
    t = 0
    for c in n:
       t += int(c) 
    return 'No' if t % 9 else 'Yes'

n = input()
print(solution(n))

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

Solution (Python):
n_str = input()
n_len = len(n_str)
sur = 0

for i in range(n_len):
    c = n_str[i]
    c_int = int(c)
    sur += c_int
    sur %= 9

if sur:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys

N = str(input())

n = list(map(int, N))

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

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

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

Solution (Python):
if __name__ == '__main__':

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

Solution (Python):
string = input()

counter = 0
for i in string:
    counter += int(i)

if counter % 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 = list(input())

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

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

Solution (Python):
import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline


mo=10**9+7
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())








for _ in range(1):
    s=sin().strip();k=0
    for i in s:
        k=(k+int(i))%9
    if(k==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):
s = input()
sum=0
a = [int(c) for c in s]
for i in a:
    sum+=i
if sum%9==0:
    print("Yes")
else:
    print("No")

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

Solution (Python):









def main():
    N = map(lambda x: int(x), list((input())))

    result = 0
    for item in N:
        result += item

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


if __name__ == "__main__":
    main()

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

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

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

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

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

Solution (Python):
N = input()
N1 = sum(map(int,str(N)))
if N1%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:
    print("No")
else:
    print("Yes")

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

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

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

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

abc176b_multiple_of_9()

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=list(map(str,input()))
q=len(N);x=0
for i in range(q):
  x=x+int(N[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 = str(input())

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

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

def digit_sum(s):
	ans=0
	for digit in str(s):
		ans+= int(digit)
	return ans

if digit_sum(digit_sum(digit_sum(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 = input()
cnt = 0

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

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

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

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

Solution (Python):
N = input()

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

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

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

Solution (Python):
N = input()

sumN = 0

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

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

Solution (Python):
N = int(input())
A = 0
N = str(N)
for iter in range(len(N)):
    A  += int(N[iter]) 
   

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

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

Solution (Python):
n=input()
a=0

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

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

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

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

Solution (Python):

l = list(map(int, list(input().strip())))
t = 0
for i in range(len(l)):
    t += l[i]
if t % 9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):





"""
"""

from collections import defaultdict
import bisect

import sys
input = sys.stdin.readline

def solve(s):
    ss = sum(map(int,s))
    if ss % 9 == 0:
        print('Yes')
    else:
        print('No')

            

def main():
    s = list(input().rstrip())
    solve(s)


if __name__ == "__main__":
    main()

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

Solution (Python):
N = input()

sumC = 0
for c in N:
  sumC += int(c)
if sumC % 9 == 0:
  print('Yes')
else:
  print('No')

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

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

Solution (Python):
import sys
input = sys.stdin.readline

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

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

Solution (Python):
s = input()

a = 0
for i in range(1, 9):
    a += i * s.count(str(i)) % 9
    a %= 9

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

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

Solution (Python):
n = input()

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):


import math
import sys
import itertools
import numpy as np

mojiretsu = list(input())

a=0

for b in mojiretsu:
    a += int(b)
    

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

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

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

Solution (Python):
n = input()
from collections import Counter

ans = 0
for k,v in Counter(n).items():
  ans += (int(k) * int(v)) % 9

ans = ans % 9

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

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

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

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

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

Solution (Python):
N = int(input())
assert N >= 0 and N <= 1e200000
if sum([int(c) for c in str(N)]) % 9 == 0:
    print("Yes")
else:
    print("No")

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

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

n = list(n)

n = [int(i) for i in n]

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

Solution (Python):
n = sum(list(map(int, list(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())
A = N%9
if A == 0:
    print("Yes")
else:
    print("No")

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

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

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

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

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

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

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

Solution (Python):

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

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

Solution (Python):
n = input()

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

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

Solution (Python):
n = input()

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

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

Solution (Python):
from collections import Counter
s = input()
dic = Counter(s)
res = 0
for i in range(1,10):
    res += i*dic.get(str(i), 0)
if res%9 > 0:
    print('No')
else:
    print('Yes')

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

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

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

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

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

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

Solution (Python):
n=input()

nine = 0
for i in n:
    nine += int(i);

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

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

Solution (Python):
n = input()

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

if sum_val % 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())

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

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

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

Solution (Python):
N = input()
ns = [int(x) for x in N]

total = 0
for n in ns:
    total += n

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

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

Solution (Python):
a = int(input())
b = list(str(a))
ans = 0
for i in b:
    ans += int(i)

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

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

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

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

Solution (Python):

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

def main():
    n = int(input())
    n_sum = digitSum(n)
    if n_sum%9==0:
        print('Yes')
    else:
        print('No')
if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
L=list(input())
M=[]
for i in range(len(L)):
	M.append(int(L[i]))

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

x = 0

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

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

Solution (Python):
s = input()
num = 0

for i in range(len(s)):
  num = (num+int(s[i]))%9

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INPUT()

    l = [int(s) for s in N]
    print("Yes" if sum(l)%9 == 0 else "No")


if __name__ == '__main__':
    main()

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

Solution (Python):
n = str(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 = int(input())
strN = str(N)
number = 0

for s in strN:
    number += int(s)

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

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

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

Solution (Python):
n = int(input())
n_sum = 0
def Sum(n):
    s = str(n)
    arr = list(map(int, s))
    return sum(arr)

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

Solution (Python):
def f(n):
    str_n = str(n)
    tmp = 0
    for i in range(len(str_n)):
        tmp += int(str_n[i])
    if tmp%9==0:
        return True
    else:
        return False
        
n = int(input())
if f(n):
    print('Yes')
else:
    print('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 = int(input())
if n%9==0:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
X  =  input().strip()  ;
t = 0 ;
for r in X : 
	t += int ( r ) ;

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

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

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

Solution (Python):
import sys
import 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
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
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

N_list = [int(s) for s in str(N)]

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

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

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

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

Solution (Python):
N=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):
print(["No", "Yes"][sum(int(c) for c in input()) % 9 == 0])

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd


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

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

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

Solution (Python):


N = int(input())


s = str(N)
l = list(map(int, s))
ans = str()
if sum(l) % 9 == 0:
    ans = "Yes"
else:
    ans = "No"


print(ans)

Solution (Python):
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')

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

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

b = digitSum(N)

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

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

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

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



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

Solution (Python):
n = input()

def main():
    nn = n.replace("9","")
    nn = n.replace("0","")
    s =  0
    for t in nn:
        s += int(t)
    
    if s % 9 == 0:
        print("Yes")
    else:
        print("No")

main()

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

Solution (Python):
in_nums = input()

total = 0
for s in in_nums:
    total += int(s)

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

Solution (Python):
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


N=list(ns())
keta=0
for i in range(len(N)):
    keta+=int(N[i])

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

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

for i in range(len(n)):
    sum += int(n[i])
    while sum >= 10:
        tmp = sum - 10
        sum = tmp + 1

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

Solution (Python):
N = input().split()
a = len(N)
b = 0
for i in range(a):
    b += int(N[i])
if b % 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())

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

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
s = input()
a = [int(c) for c in s]

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

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

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

Solution (Python):
a = input()
tot = 0
for i in range(len(a)):
    tot += int(a[i:i+1])

if tot%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(i) for i in list(input())])
if n % 9 == 0:
    print("Yes")
else:
    print("No")

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

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

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

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

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

Solution (Python):

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: str):
    summation = 0
    for n in N:
        summation += int(n)
    if summation % 9 == 0:
        print(YES)
    else:
        print(NO)
    return



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(input())
n = [int(x) for x in n]
if sum(n) % 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):
def readinput():
    n=input()
    return n

def main(n):
    sum=0
    j=len(n)-1
    while(j>=0):
        sum+=int(n[j])
        j-=1
    if sum%9==0:
        return 'Yes'
    else:
        return 'No'

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

Solution (Python):
def main():
    n = input()
    ans = 0
    for elem in n:
        ans = (ans + int(elem))%9
    print("Yes" if ans % 9 == 0 else "No")
        
    
        
if __name__ == "__main__":
    main()

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 = input()
k=0
for i in n:
    k+=int(i)
    k%=9

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

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

Solution (Python):

n = input()
num = [int(i) for i in n]

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

Solution (Python):
from collections import defaultdict
import numpy as np

if __name__ == '__main__':
    s = input()
    count = 0
    for elem in s:
        count += int(elem)

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

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

Solution (Python):
import numpy as np

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

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

Solution (Python):
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")

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