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()
list_num = list(n)
list_num = [int(n) for n in list_num]
ans = sum(list_num)

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

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

Solution (Python):
num = input()

num = str(num)

list_num = list(num)

list_num = [int(s) for s in list_num]

ans = 0

for n in list_num:
    ans += n
    ans  = ans%9

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

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

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

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

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

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

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

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

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

Solution (Python):
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math

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

Solution (Python):
import math
t = list((input()))
sum=0
for e in t:
    sum+=int(e)
if sum%9==0:
    print('Yes')
else:
    print('No')

Solution (Python):
A = list(input())
for n in range(len(A)):
    A[n] = int(A[n])

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

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

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

Solution (Python):
N = input()
def cal(a):
    nine = 0
    for i in range(len(a)):
        nine += int(a[i])
    return nine

print(['No',"Yes"][cal(N)%9==0])

Solution (Python):
import sys
import math

N = int(input())

n = str(N)

a = list(map(int,n))

n_sum = sum(a)

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

Solution (Python):

import math

numList = []
result = []

user2 = input()
total = 0
for i in user2:
    total += int(i)

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

print(result)

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

s = str(n)
s_l = list(map(int, s))
sum = sum(s_l)

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

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

Solution (Python):
n_str = str(input())
x = 0
for e in n_str:
    x += int(e)
print('Yes') if x % 9 == 0 else print('No')

Solution (Python):
n=list(input())
n=map(int,n)
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 = input()
a = 0
for i in n:
    a += int(i)
if a % 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(i) for i in input()]

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

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

Solution (Python):
N = list(map(int, input().split()))
sum_ = 0

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

Solution (Python):

n = list(str(input()))

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

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

Solution (Python):
def Qb():
    n = [int(v) for v in input()]
    ans = 'No'
    if sum(n) % 9 == 0:
        ans = 'Yes'
    print(ans)


if __name__ == '__main__':
    Qb()

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

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

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

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

Solution (Python):
n = input()
sum = 0
for k in n:
  sum += int(k)
if sum % 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):
n = input()
ans = 0
for i in n:
  ans  += int(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):
n=int(input())
sum=0
for i in str(n):
  sum = sum +  int(i)
if(sum%9==0):
  print("Yes",end='\n')
else:
  print("No",end='\n')

Solution (Python):

import sys

N =input().strip()

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

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

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

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

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

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

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

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

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

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

Solution (Python):
num = sum(int(d) for d in input())
a = ['No', 'Yes'][num % 9 == 0]
print(a)

Solution (Python):
t = 0
for x in map(int, list(input())):
    t += x

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

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

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

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

a = sum(N)

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

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

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

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

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

Solution (Python):
N = input()

x = 0
for i in range(1, 9):
    x += i * N.count(str(i))

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

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

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

count = 0
for num in N:
    count += num

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

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

l = str(N)
A = list(map(int, l))
a = sum(A)
  
if a % 9 == 0:
  print("Yes")

else:
  print("No")

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

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

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

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

sum=0
for i in range(0,nn):
  aa=float(n[i])
  sum+=aa

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

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

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

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

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

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

Solution (Python):

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

Solution (Python):
from sys import stdin

N = stdin.readline().rstrip()
S = [int(s) for s in list(N)]
if sum(S) % 9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = input()
cnt = 0
for i in range(len(n)):
    cnt +=int(n[i])
    cnt = cnt % 9
if cnt % 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()
sum = 0

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

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

Solution (Python):
N=int(input())
X=N%9
if X==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):
def resolve():
    n = str(input())
    s = sum(list(map(int, n)))
    if s % 9 == 0:
        print('Yes')
    else:
        print('No')

resolve()

Solution (Python):
def main():
    n = input()

    s = 0

    while n:
        s += int(n[-1])
        n = n[:-1]
    
    if s%9==0:
        print('Yes')
    else:
        print('No')
        
if __name__=='__main__':
    main()

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

Solution (Python):
N = input()

N_len = len(N)
N_sum = 0


for i in range(N_len):
    N_sum += int(N[i])

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

print(ans)

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

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

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

Solution (Python):
str_n = input()

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

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

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

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

Solution (Python):
from sys import exit, stdin







N = input()

ans = 0
for i in N:
    ans += int(i)
    ans %= 9

if ans == 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):
n = int(input())
sum_of_n = 0
for digit in str(n):
    sum_of_n += int(digit)
    

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

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    if n%9 == 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

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

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

Solution (Python):
"""
AtCoder :: Beginner Contest 176 :: B - Multiple of 9 
https://atcoder.jp/contests/abc176/tasks/abc176_b
"""
import sys


def main():
    """Main program."""
    N = [int(i) for i in sys.stdin.readline().strip()]
    if sum(N) % 9 == 0:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7





n = I()
s = 0

n_list = list(str(n))

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

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

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

Solution (Python):
n = input()

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


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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

def main():

    n = str(input().strip())

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

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

main()

Solution (Python):
N = input()

s = 0

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

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

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

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

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

t = 0

for i in Ni:
  t += i

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

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

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

Solution (Python):
def main():

    N = input()

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

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

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

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

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

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

Solution (Python):
sum = 0
for num in str(input()):
  sum += int(num)

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

Solution (Python):
'''بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ'''

gi = lambda : list(map(int,input().split()))
if sum(list(map(int, list(input())))) % 9:
	print("No")
else:
	print("Yes")

Solution (Python):
num = input()

sum=0

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

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

print(ans)

Solution (Python):
N = list(map(int,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):
s = 0
for x in input():
  s = (s + int(x)) % 9
print('YNeos'[s>0::2])

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a = rr()
b = 0
for i in a:
  b += int(i)
  b = b%9
if b == 0:
  print('Yes')
else:
  print('No')

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

Solution (Python):
import sys
import copy
from collections import deque
import collections
import itertools
stdin = sys.stdin
import math

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ns()

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

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
n=int(input())
s = str(n)
array = list(map(int, s))
ans=sum(array)

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

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

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

Solution (Python):
import numpy as np

N = input().rstrip()
L = [int(N[i]) for i in range(len(N))]
M = np.array(L)
sum_M = np.sum(M)

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

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

main()

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

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

Solution (Python):
n = input()
num = str(n)
list_num = list(num)
l = [int(s) for s in list_num]

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

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

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

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

Solution (Python):
n = input()
s = list(n)
sum = 0
for a in s:
    sum += int(a)
    sum %= 9

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

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

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

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

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

Solution (Python):
def resolve():
    target = input()
    target_sum = sum([int(i) for i in target])
    if target_sum%9 == 0:
        print('Yes')
    else:
        print('No')
resolve()

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

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

Solution (Python):
n=input()

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

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

Solution (Python):
import math

n = input()
array = list(map(int,n))
sum_9 = sum(array)

if sum_9%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:
   ans = 'Yes'
else:
   ans = 'No'
print(ans)

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

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

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

    answer = 0

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

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

if __name__ == "__main__":
    main()

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

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


if __name__ == '__main__':
    main()

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

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

if __name__ == "__main__":
  resolve()

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

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy


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

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

sum = 0
for item in range(n):
  sum += int(N[item])

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

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

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

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

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

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

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

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

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

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

Solution (Python):
N=input()

AAA = map(int, list(N))

BBB = sum(AAA)

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

Solution (Python):
import math

n = list(input())

t = 0
for i in n:
    t += int(i)
    t %= 9

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

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

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

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

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

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

temp = 0
for x in str(N):
    temp += int(x)

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

print(ans)

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):
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
n=int(input())
s=str(n)
ans=0
for i in s:
    ans+=int(i)
if ans%9==0:
    print("Yes")
else:
    print("No")

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

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

 
a = list(input().rstrip())

ans = 0

for dig in a:
  ans += int(dig)
  

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

Solution (Python):
S=input()
L=len(S)

goukei=0
for i in range(L):
    goukei+=int(S[i])

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

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

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

Solution (Python):
def main():
    N = int(input())
    answer = solve(N)
    print(answer)


def solve(N):
    digits = (int(char) for char in str(N))

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


if __name__ == "__main__":
    main()

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

Solution (Python):

 
N = input()

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


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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

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

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

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

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

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

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

Solution (Python):
N = input()

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

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

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

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

a = 0
for i in N:
    a += int(i)
    a = a % 9

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

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

Solution (Python):
N = input()
s = [char for char in N]
sum_ = 0
for char in s:
    sum_ += int(char)
if sum_ % 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:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Solution (Python):

n=list((input()))
x=0
for i in n:
    x+=int(i)

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

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

total = sum(array)

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

Solution (Python):
import os
import heapq
import sys,threading
import math
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10**5)
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]

def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)

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

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

if __name__ == "__main__":
    main()

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

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

sum_nine()