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 = sum(list(map(int, input().split())))

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

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

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

Solution (Python):
nli = list(map(int,input().split()))
a = sum(nli)
if a%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 = list(input())
n_sum = sum([int(i) for i in n])
if n_sum %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(str(input()))
N_int = [int(i) for i in N]
if sum(N_int)%9 ==0:
    print('Yes')
else:
    print('No')

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

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

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

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

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

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

Solution (Python):
n = input()
a = 0
for i in n:
    a += int(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):


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


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

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= c+int(n[i])
if(c%9==0):
    print("Yes")
else:
    print("No")

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

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

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

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

else:
    print("No")

Solution (Python):

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

x = int(input())

L = digitSum(x)

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

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

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

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

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

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

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

Solution (Python):
x = input()


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

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

Solution (Python):
a=input()
b=0
kei=0
while(b!=len(a)):
    kei+=int(a[b])
    b+=1
if(kei%9==0):
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
n = input()

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

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

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

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

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

Solution (Python):

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

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

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

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

sum_reslt=0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import math

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

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



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

else:
    print("No")

Solution (Python):


N = input()
ar = list(map(int, N))
ans = sum(ar)

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

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

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

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

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

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

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

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

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

    count = 0

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

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

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

x = result % 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):
def run(x):
    '''

    '''


    
    
    
    

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


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

Solution (Python):
s=input()
l=[]
sm=0
arr=["0","1","2","3","4","5","6","7","8","9"]
for i in range(0,10):
  l.append(s.count(arr[i]))
for i in range(0,10):
    a=int(l[i])
    sm=sm+(a*i)
if sm%9==0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = sum(map(int, list(input())))
if N % 9 == 0:
  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=input()



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

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

Solution (Python):
def ans(n): 

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

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

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

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

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

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

    return 'No'

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

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

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

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

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

Solution (Python):
N = input()
if N == 0:
  print('Yes')
else:
  N = str(N)
  L = list(N)
  L = [int(s) for s in L]
  X = sum(L)
  if X % 9 == 0:
    print('Yes')
  else:
    print('No')

Solution (Python):
import sys
n= int(input())
A=list(map(int, str(n)))
s=0
b=len(A)
for i in range(b):
    s=s+A[i]%9
if s%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):
n=int(input())
if n%9==0:
    print("Yes")
else:
    print("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 =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=input()
sum=0
for i in N:
    sum+=int(i)
if sum%9==0 and int(N)%9==0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
A = input()



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

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

else:
    print("No")

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

Solution (Python):
n = list(str(input()))
n = [int(i) for i in n]
total = sum(n)

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

Solution (Python):
n = input()

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

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

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

print(ans)

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

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

Solution (Python):
N = int(input())
strN = str(N)
wa = 0
for i in strN:
  wa += int(i)

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

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

Solution (Python):

N = list(map(int,input()))
n = 0
for i in N:
  n += i

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

Solution (Python):
import collections 

N = input()
D = collections.Counter(N)
ret = 0
for c in D.keys():
  ret += int(c) * D[c]
  ret = ret % 9
  
if ret  == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = str(input())
list_N = list(N)
list_N = [int(s) for s in list_N]
ans = 0
for i in range(len(list_N)):
    ans += list_N[i]
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):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

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

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

Solution (Python):
n = int(input()) 
ans = sum(list(map(int, str(n)))) % 9

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

Solution (Python):
N = input()

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

ans = 'Yes' if total % 9 == 0 else 'No'

print(ans)

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

Solution (Python):
N = input()
char_list = list(str(N))
result = 0
for i in char_list:
    result = result + int(i)

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

Solution (Python):
list_N =list(map(int,list(input())))
total = 0
for i in list_N:
    total += i
if total % 9 == 0:
    print("Yes")
elif total % 9 != 0:
    print("No")
else:
    pass

Solution (Python):

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

if __name__ == '__main__':
    main()

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

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

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

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

for i in str(n):
    total += int(i)

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

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

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

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

sum_of_digits = sum(int(digit) for digit in str(number))

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

Solution (Python):


import math

if __name__ == '__main__':
    N_str = input()
    N_array = list(map(int, N_str))
    
    if sum(N_array)%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):
a = input()
a = list(a)
ans = 0
for i in a:
    i =int(i)
    ans += i
if ans%9==0:
    print("Yes")
else :
    print("No")

Solution (Python):
N = input()

n_list = list(N)

ans = 0

for k in n_list:
    ans += int(k)

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

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

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

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

if N%9 == 0:
  ans = 'Yes'
else:
  ans = 'No'

print(ans)

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

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

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

Solution (Python):
N = input()
L = len(N)
c = 0

for i in range(L):
    k = int(N[i])
    c = k + c

if c%9 == 0:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Solution (Python):
n = input()

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

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

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

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

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

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

Solution (Python):
i = input()

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n = int(input())
if n == 0:
    print("Yes")
    exit()

mod = n%9

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

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

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

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

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

Solution (Python):
import sys
li  =   lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw  =   lambda : sys.stdin.readline().strip().split()
ni  =   lambda : int(sys.stdin.readline().strip())
nsi =   lambda : sys.stdin.readline().strip()

from collections import defaultdict as df
import math
s=input()
sum=0
for i in s:
    sum+=int(i)

if(sum%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):
import sys
input = sys.stdin.readline
I = lambda : list(map(int,input().split()))

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

Solution (Python):
N = input()
num=0
if int(N)%9 !=0:
  print('No')
else:
  for i in range(len(N)):
    num+=int(N[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):
a = int(input())
s = str(a)
array = list(map(int, s))
if sum(array) % 9 ==0:
  print("Yes")
else:
  print("No")

Solution (Python):
import math
x = input()
c = 0
for k in x:
  c += int(k)
if c % 9 ==0:
  print('Yes')
else:
  print('No')

Solution (Python):
N = input()
l = [int(s) for s in list(N)]
ans = sum(l)

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

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

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

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

N = int(input())

if digitSum(N) % 9 == 0 and N % 9 == 0:
    print('Yes')
else:
    print('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 = 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()
count=0
for n in range(len(N)):
    count+=int(N[n])
    
if count%9==0:
    print("Yes")
else:
    print("No")

Solution (Python):
def is_nine(x):
    res = 0
    while x > 0:
        t = x % 10
        res += t
        x //= 10
    return res

if __name__ == '__main__':
    N = list(input())
    e = 0
    for i in N:
        e += int(i)
        
    if (e % 9 == 0):
        print("Yes")
    else:
        print("No")

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

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

N = int(input())
sum = digitSum(N)

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

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

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

if temp % 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 i in range(0, len(N)):
    Ans += int(N[i])
    Ans = Ans % 9

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

Solution (Python):
N = input()

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

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

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

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

aha=digitSum(na)

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

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

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

Solution (Python):

N = input()
eachSum = 0

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

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

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

Solution (Python):
import math


N =list(input())

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

if cnt%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):
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):




n = int(input())


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

Solution (Python):
n=str(input())
k=0
while len(n)>=2:
  for i in n:
    k+=int(i)
    
  n=str(k)
  k=0
if n=='9'or n=='0':
  print('Yes')
else:
  print('No')

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

Solution (Python):
import sys

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

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

Solution (Python):
N = input()

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

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

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

result = N%9

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

Solution (Python):
import numpy as np
X = int(input())
S = str(X)
L=[int(i) for i in S]
Y=np.sum(L)
if Y%9==0:
    ans="Yes"
else:
    ans="No"

print(ans)

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

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

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

str_ = input()
sum_ = sum([int(s) for s in str_[:-1]])
print('Yes' if sum_ % 9 == 0 else 'No')

Solution (Python):

import time

start_time = time.time()

n = str(input())

one = n.count('1')
two = n.count('2') * 2
three = n.count('3') * 3
four = n.count('4') * 4
five = n.count('5') * 5
six = n.count('6') * 6
seven = n.count('7') * 7
eight = n.count('8') * 8
nine = n.count('9') * 9

ans = one + two + three + four + five + six + seven + eight + nine

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

else:
    print('No')

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

Solution (Python):
a = input()
bool = False
n=0
for b in a:
  n += int(b)
if n % 9 == 0:
  bool = True
    
if bool==True:
  print("Yes")
else:
  print("No")

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

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

Solution (Python):

N = input()
ans = []
print('Yes' if sum(map(int,list(N))) % 9 == 0 else 'No')

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

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

Solution (Python):
N = input()

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


res = sum%9
if res==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 print('No')

Solution (Python):
def solve():
    
    N = input()

    ans = 0

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

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


if __name__ == "__main__":
    solve()

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

Solution (Python):
N = input()

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

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

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

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

Solution (Python):

n = input()


_sum = 0

for e in range(len(n)):
    _sum = _sum + int(n[e])

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

Solution (Python):
N=input()

L=(len(N))
i,s=0,0

while i<L:
  s+=int(N[i])
  i+=1
  
if (s%9==0):
  print('Yes')
else:
  print('No')

Solution (Python):
n=input()

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

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

Solution (Python):
n=input()
n=n[::-1]
k=len(n)
rem=0
for i in range(k):
    rem+=pow(10,i,9)*int(n[i])
    rem%=9

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

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

def main():
    N = readline().rstrip()
    ans = 0
    for n in N:
        ans += int(n)
    print('Yes' if ans % 9 == 0 or ans == 0 else 'No')

if __name__ == "__main__":
    main()

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

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

Solution (Python):
s = input()

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


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

Solution (Python):

import sys


def main():
    N_str = sys.stdin.readline().rstrip()

    sum_digit = 0

    for s in N_str:
        sum_digit += int(s)
    
    if (sum_digit % 9 == 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 = list(input())

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

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

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



if N==0:
    print('Yes')
    exit()

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

Solution (Python):
s=input()
sum1=0
for i in range(len(s)):
    sum1+=(ord(s[i])-48)
if sum1%9==0:
    print('Yes')
else:
    print("No")

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

total = sum(n)

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):
x = input()
sum=0
for i in x:
  sum=sum+int(i)
if sum%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")