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

sm = 0

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

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

Solution (Python):
n = map(str,input().split())

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

Solution (Python):



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

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

Solution (Python):

mod = 9
arr = list(map(int, input()))
di = 0
for a in arr:
  di += a
  di = di%mod
if di == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
n = input()

t = 0

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):

n = int(input())

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

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

Solution (Python):
n,t=input(),0

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

print('No' if t%9 else 'Yes')

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

Solution (Python):
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):
s = input()



print('Yes' if sum(int(t) for t in s) % 9 == 0 else 'No')

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

Solution (Python):
n = input()

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

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

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

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

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

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

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

else:
  print("No")

Solution (Python):
N = str(input())
cnt = 0
for i in range(10):
  cnt += i * N.count(str(i))
  
print('Yes' if cnt % 9 == 0 else 'No')

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

Solution (Python):
n = input()
total = 0
for i in range(10):
    total += n.count(f'{i}') * i
print('Yes' if total%9==0 else 'No')

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

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

Solution (Python):
S = input()

s_list = [int(i) for i in S]
if sum(s_list) % 9 == 0:
  print('Yes')
else:
  print('No')

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

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

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

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

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

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

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

Solution (Python):
N = input()

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

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

Solution (Python):
N = input()

S = 0
for d in N:
    S += int(d)

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n=input()

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

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

Solution (Python):
n=input()

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

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

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

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

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

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

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

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


def main():
    n = list(input().rstrip())
    total = sum(map(int, n))
    if total % 9 == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

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

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
s = input()

def rec(s):
    if len(s) == 1:
        print('Yes' if s in ('0', '9') else 'No')
        sys.exit()

    acc = 0
    for c in s:
        acc += int(c)

    rec(str(acc))

print(rec(s))

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

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

Solution (Python):

n=input()





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

Solution (Python):


import sys
sys.setrecursionlimit(10**6)

def main():
    N = int(input())
    def calcSumOfDigit(x):
        str_x = str(x)
        acc = 0
        for s in str_x:
            acc += int(s)
            acc %= 9
        return acc
    
    print("Yes" if calcSumOfDigit(N)==0 else "No")
    return


if __name__ == '__main__':
    main()

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

Solution (Python):
N = input()

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

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

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

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

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

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

print('No' if sum(n) % 9 else 'Yes')

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

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

A = sum(N)

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

Solution (Python):

N = int(input())

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

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

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

digit_sum = 0
strN = str(N)

for i in range(len(strN)):
    digit_sum += int(strN[i])

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

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

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

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

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

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

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

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

Solution (Python):

import itertools
import numpy as np
import fractions
from itertools import combinations
from functools import reduce
from functools import lru_cache
import math
from collections import deque
import decimal
import bisect
import heapq
import sys
sys.setrecursionlimit(10**9)


YES = "Yes"  
NO = "No"  


def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def solve(N: str):
    s = 0
    for n in N:
        m = int(n)
        s += m
        s %= 9
 
    print(YES if s % 9 == 0 else NO)
    return

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



if __name__ == "__main__":
    main()

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

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

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

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

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

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

Solution (Python):
n = input()

temp = 0

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


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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
def digit_sum(n):
    n_lst = list( str(n) )
    n_sum = 0
    for i in range( len(n_lst) ):
        n_sum += int( n_lst[i] )
    return n_sum
 
n1 = input()
if digit_sum(n1)%9==0 : print("Yes")
else: print("No")

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

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

Solution (Python):
s = list(input())
tot = sum(map(int, s))
print("Yes" if tot % 9 == 0 else "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):
if(sum([int(i) for i in input()]) % 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
readline=sys.stdin.readline

N=readline().rstrip()

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

Solution (Python):
N = list(input())
NSum = 0
ans = "No"

for i in N:
  NSum += int(i)
if NSum % 9 == 0:
  ans = "Yes"
print(ans)

Solution (Python):
N=int(input())
n=str(N)
listst=list(n)
lists=[int(str) for str in listst]

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

Solution (Python):

from collections import defaultdict 
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()

s = input()

ans = 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n = input()

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

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

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

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

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

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

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

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

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

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

Solution (Python):

def tc():
    n = int(input())
    digsum = sum(map(int, str(n)))
    if digsum % 9:
        print('No')
    else:
        print('Yes')


tc()

Solution (Python):
def ismof9(n):
    _str = str(n)
    _sum = 0
    for ch in _str:
        _sum += int(ch)
    if _sum % 9 == 0:
        return "Yes"
    else:
        return "No"


def main():
    n = int(input())
    print(ismof9(n))

main()

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

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

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

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(10000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

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

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

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

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

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

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

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

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

Solution (Python):
def check(st) :  
    n = len(st) 
    digitSum = 0
      
    for i in range(0,n) : 
        digitSum = digitSum + (int)(st[i])
    return (digitSum % 9 == 0) 
st=input()
if (check(st)):
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
s=input()
a=int(eval("+".join(s)))
if a%9:
    print("No")
else:
    print("Yes")

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

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

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

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

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

Solution (Python):
n = int(input())
print('Yes' if 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):




from sys import stdin, stdout, setrecursionlimit
from math import gcd, ceil, sqrt
from collections import Counter, deque
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
setrecursionlimit(100000)
mod = 1000000007

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

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

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

Solution (Python):
number = int(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):
if int(input())%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()
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()

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

print(["No", "Yes"][res % 9 == 0])

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

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

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

Solution (Python):
import sys

input=sys.stdin.readline

def linput(ty=int, cvt=list):
	return cvt(map(ty,input().rstrip().split()))

def vinput(rep=1, ty=int, cvt=list):
	return cvt(ty(input().rstrip()) for _ in "*"*rep)

def facto(x, y, mod):
	re = 1
	for i in range(y, x+1):
		re *= i
		re %= mod
	
	return re

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
NN = 10**5+10
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1] 

def init_comb():
    for i in range( 2, NN + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )


def main():
	A,B = linput()
	M = mod
	
	res = cmb(B+1, A+1, M)
	print(res)

def solve():
	S, = linput(str)
	res = 0
	mod = 9
	
	t = int(S)%9
	
	
	sT = "No Yes".split()
	res = sT[t < 1]
	print(res)
	
	
solve()

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

Solution (Python):
import sys

input=sys.stdin.readline

def linput(ty=int, cvt=list):
	return cvt(map(ty,input().rstrip().split()))

def vinput(rep=1, ty=int, cvt=list):
	return cvt(ty(input().rstrip()) for _ in "*"*rep)

def facto(x, y, mod):
	re = 1
	for i in range(y, x+1):
		re *= i
		re %= mod
	
	return re

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
NN = 10**5+10
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1] 

def init_comb():
    for i in range( 2, NN + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )


def main():
	A,B = linput()
	M = mod
	
	res = cmb(B+1, A+1, M)
	print(res)

def solve():
	S, = linput(str)
	res = 0
	mod = 9
	
	t = 0
	for s in S:
		t = 10*t + int(s)
		t %= mod
	
	sT = "No Yes".split()
	res = sT[t < 1]
	print(res)
	
	
solve()

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

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

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

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

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

Solution (Python):
N = input()

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

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

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

Solution (Python):
import math

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

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

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

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

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

print(["No", "Yes"][total % 9 == 0])

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

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

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

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

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

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

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

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

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

for x in n:
    cur += int(x)

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

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

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

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

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

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

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

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

Solution (Python):



def main(n):
    s = 0
    for u in list(n):
        s += int(u)
        if 8 < s:
            s = s % 9
    return s == 0


N = input().strip()
result = main(N)
if result:
    print('Yes')
else:
    print('No')

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

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

a = 0
for num_s in n_list:
    a += int(num_s)

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

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