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

for n in N:
    n_sum += n

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

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

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

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

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

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

Solution (Python):
import math

if __name__ == "__main__":
    n = input()
    sum_n = 0
    for n_i in n:
        sum_n += int(n_i)
    if sum_n%9==0:
        print("Yes")
    else:
        print("No")

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

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

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

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

Solution (Python):
n=input()
tmp = 0
for i in range(10): 
    c=n.count(str(i))
    tmp += c*i

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

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

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

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

Solution (Python):
def main():
    N = input()
    if int(N) < 0 or int(N) >= 10**200000:
        raise ValueError
    i = 0
    sum = 0
    for i in N:
        sum += int(i)
        if sum % 9 == 0:
            sum = 0
    if sum % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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

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

Ns = 0

for x in N:
    Ns = Ns + int(x)

loops = 0
while Ns > 10:
    Ns_str = str(Ns)
    Ns = 0
    for x in Ns_str:
        Ns = Ns + int(x)
    loops = loops + 1
    if loops > 1000000:
        break

if Ns == 9 or Ns == 0:
    print("Yes")
else:
    print("No")

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

while i < L:
    sum = sum + int(S[i])
    i = i + 1
    
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 math
def main(lines):
  n = len(lines)
  x = 0
  for i in range(n):
    x+=int(lines[i])
    
  if x//9 == math.ceil(x/9):
    print('Yes')
  else:
    print('No')

if __name__ == '__main__':
    lines = input()
    main(lines)

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

Solution (Python):
N = input()

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

Solution (Python):
if __name__ == "__main__":
    n = list(input())
    n = [int(i) for i in n]

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

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

Solution (Python):

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

Solution (Python):
word = list(input())
A = len(word)
T = 0
for i in range(A):
    T += int(word[i])

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

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

Solution (Python):
N = input().strip()
summ = sum([int(i) for i in N])

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

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

Solution (Python):
n = input()
l = len(n)
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()
l = [int(x) for x in list(N)]
s=sum(l)
if s%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):
Nstr = input()

n = list(Nstr)

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

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

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

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

s = readline().rstrip().decode('utf-8')

ans = 0

for i in s:
    ans += int(i)

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

Solution (Python):
N_str = input()
N_int = int(N_str)

summ = 0

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

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

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

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

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

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

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

Solution (Python):
n = str(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 = N % 9

if k == 0:
    print('Yes')
    
if k != 0:
    print('No')

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

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

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

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

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

Solution (Python):
n = map(int, list(input()))
print("Yes" if sum(n) % 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 = len(N)
S = 0

for i in range(n):
    S += int(N[i])

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

else:
    print("No")

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

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

Solution (Python):
n = input()

res = 0
s = list(n)
for i in s:
    res += int(i)

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

Solution (Python):
n = int(input())
l = len(str(n))
wa = 0
if l >= 2**15:
    n = str(n)
    for i in range(l):
        wa += int(n[-i])
else:
    wa = n
if wa % 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()

asdf = 0
for idx in range(len(N)):
    asdf += int(N[idx])

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

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

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

Solution (Python):
N = input()
l = len(N)

x = 0
for i in range(l):
    x += int(N[i])

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

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

listN = list(n)

result = 0

for value in range(len(listN)):
    result += int(listN[value])

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

Solution (Python):
from sys import stdin,stdout
s=sum([int(v) for v in input()])
print('No' if s%9!=0 else 'Yes')

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

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

Solution (Python):
import math
n = str(input())
    
running_sum = 0
for i in n:
    if i != "0" and i != "9":
        running_sum += int(i)

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

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

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

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 = input()
res = sum((ord(x) - ord("0")) for x in n)
print("Yes" if res % 9 == 0 else "No")

Solution (Python):

import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
from functools import lru_cache

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

N = S()
total = 0
for c in N:
    total += int(c)

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

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

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

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

ans = 0
N = str(N)

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

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

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

Solution (Python):
N=str(input())
L=len(N)
X=0
ans=None

for i in range(0,L):
    Y=int(N[i])
    X=X+Y

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

print(ans)

Solution (Python):
A=input()
B=int(9)
i,j=divmod(int(A),int(B))
if j == 0:
  j="Yes"
else:
  j="No"
print(j)

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line.strip())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = lines[0]

    return (n, )


def solve(n, ):

    
    total = sum([int(e) for e in n])

    result = 'No' 
    
    if total % 9 == 0:
        result = 'Yes'


    return result 


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

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

Solution (Python):
N = input()

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

Solution (Python):
ans = input()
a = str(ans)
c = 0
for f in a:
  b = int(f)
  c = c + b
inp = c % 9
if inp == 0:
  print('Yes')
if inp != 0:
  print('No')

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

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







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

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

Solution (Python):
tmp = input().rstrip()
x = 0
for f in tmp:
    x = x*10+int(f)
    x %= 9
print("Yes" if x == 0 else "No")

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

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

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

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

Solution (Python):
n = int(input())
result = n % 9

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

Solution (Python):
import math

a = input()
l = len(a)
ans = 0
for i in range(l):
    ans = ans + int(a[i])

if math.ceil(ans / 9 ) == ans /9:
    print("Yes")
else:
    print("No")

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

Solution (Python):
N = input()
M = 0
l = [int(x) for x in list(str(N))]
for i in range(len(l)):
    M += l[i]
if M % 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(i) for i in str(int(input()))]

if 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):
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())

n=input()
x=0
for i in n:
    x+=int(i)
    x%=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 = int(input())
n = str(N)
list = [i for i in n]
plus = 0

for j in list:
    plus += int(j)

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

Solution (Python):
N = input()
m = 0
for x in N:
    m = (m + int(x)) % 9
if m == 0:
    print("Yes") 
else:
    print("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):
s = input()
bara = list(s)
n = [int(s) for s in bara]

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

Solution (Python):
N=input()
N=list(N)
N=list(map(int,N))
c=len(N)
b=0

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

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

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

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

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

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

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

N_list = list(map(float, N))
sumN = sum(N_list)
judge = sumN/9 - int(sumN/9)
if judge == 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 = 0
for i in N:
  n += int(i)
  
if n%9 == 0:
  print('Yes')
else:
  print('No')

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

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

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

Solution (Python):

lst = input()
lst1= []
for i in lst:
    if i != '.':
        lst1.append(int(i))
q = 0
for i in lst1:
    q+=i
if q%9 == 0:
    print('Yes')
else:
    print('No')

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

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)

n = int(input())
d_s = digitSum(n)

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

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

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

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

Solution (Python):
a=list(input())
sum=0

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

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

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


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

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

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

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

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

Solution (Python):
k=sum(map(int, str(input())))
if k%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
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    ans = 0
    for rep in n:
        ans += int(rep)
        ans %= 9
    if ans==0:
        print('Yes')
    else:
        print('No')
    return

if __name__=='__main__':
    n = S()
    solve()

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

Solution (Python):
n=input()
num=int(n)
nl=list(n)
sum=0

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

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

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = input()
v = 0
for c in n:
    v += int(c)
if v%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):
def main():
  N = input()
  N_sum = 0
  
  for i in N:
    N_sum += int(i)
    
  if N_sum % 9 == 0:
    print("Yes")
  else:
    print("No")
  
if __name__ == "__main__":
  main()

Solution (Python):
n = str(input())
a = int(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()



s = 0

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

Solution (Python):




n = input()



l = map(int, list(n))

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

Solution (Python):


if __name__ == '__main__':
    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):
z=[]
a=input()
for i in a:
    z.append(int(i))
a=sum(z)
b=str(a/9)
a2=b[b.index("."):]
if a2=='.0':
    print('Yes')
else:
    print('No')

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

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

Solution (Python):

N = input().split()

lenN = len(N)
x = 0

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

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

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

Solution (Python):
N = input().rstrip()

N_sum = 0

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

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

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

N = readline().strip()

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

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

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

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

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

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

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

Solution (Python):
x=input()

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

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

Solution (Python):
n = input()

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

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

Solution (Python):
def digitSum(n):
    s = str(n)
    array = list(map(int,s))
    return sum(array)
a = int(input())
if digitSum(a) % 9 == 0:
    print('Yes')
else:
    print('No')

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

Solution (Python):
ln = input()
score = 0

for i in range(len(ln)):
  score += int(ln[i])

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

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

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

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

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

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

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

Solution (Python):

import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 


from math import gcd, ceil

def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[j - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] =  j
    return pi

def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans

def lcm(a, b): return a * b // gcd(a, b)

def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else '0' * (length - len(y)) + y


def solve(N):
    a = 0
    for i in N:
        a += int(i)
    return "Yes" if a % 9 == 0 else "No"

N = input()
print(solve(N))

Solution (Python):
N = input()
A = 0
for i in range(1,1+len(N)):
    A += int(N[-i])

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

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

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

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

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

Solution (Python):
def test(a):
  b = 0
  for i in a:
    b = b + int(i)
  return b
     
a = input()
b = test(a)

c = b%9

if c == 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=list(input())
NN=[int(t) for t in N]
T=sum(NN)
if T%9==0:
    print("Yes")
else :
    print("No")

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

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

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

ans = L % 9
if ans == 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:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
sys.setrecursionlimit(1000000)
n=input()
def f(x):
    if len(x)>1:
        
        a=0
        for i in range(len(x)):
            a+=int(x[i])
    
        f(str(a))
    else:
    
        if x=="9" or x=="0":
            print("Yes")
            return
        else:
            print("No")
            return
f(n)

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

Solution (Python):
def getsum(N):

    sum = 0
    while(N != 0):
        sum = sum + int(N%10)
        N = int(N//10)

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

Solution (Python):
n = input()
l = len(n)
s = 0
for i in  range(l):
  if(n[i]!='-'):
  	s += int(n[i])

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

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

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    
    
    
    s = input()
    res = 0
    for char in s:
        res = (res + int(char)) % 9
    print('Yes' if res == 0 else 'No')



if __name__ == "__main__":
    main()

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

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

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

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

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

main()

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

num_list = [int(x) for x in list(str(n))]

total = 0

for i in num_list:
    total += i

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

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

Solution (Python):
n=input()
cnt =   n.count("1") +2*n.count("2")+3*n.count("3")+4*n.count("4")+5*n.count("5")+6*n.count("6")+7*n.count("7")+8*n.count("8")+9*n.count("9")
if cnt%9 == 0 :
    print ('Yes')
else :
    print ('No')

Solution (Python):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    now = 0
    for c in input():
        now += int(c)

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