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):
import math
import itertools
import sys
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()
nc = str(n)
ans = 0
for i in nc:
    ans += int(i)
if ans % 9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):












N=int(input())



N = str(N)

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

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

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

Solution (Python):

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

Solution (Python):
str=list(input())
num=0
for i in str:
  num+=int(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=list(map(int,input()))

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

Solution (Python):



import collections
import sys
import copy
import re
import math
import itertools


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


def main():
    N = I()

    NStr = str(N)

    keta = 0
    for n in NStr:
        keta += int(n)

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


if __name__ == '__main__':
    main()

Solution (Python):


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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: str):
    sum = 0
    for i in N:
        sum += int(i)
        if sum >= 9:
            sum -= 9
    print(YES if sum == 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().strip()

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

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

Solution (Python):
N = input()

is_multiple_of_9 = sum(map(int, list(N))) % 9 == 0

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

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

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

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

Solution (Python):


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

Solution (Python):
n = input()

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

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

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

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

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

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

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

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

Solution (Python):
N=list(map(int,input()))
cnt=0
for i in N:
    cnt+=i

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

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

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

nn=list(map(int, n))

x=sum(nn)

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

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

Solution (Python):

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

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

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

Solution (Python):
N=input()

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

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

Solution (Python):

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

def add(a, b):
    return a+b

if functools.reduce(add, n, 0) % 9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):



N=input()
ls=list(map(int,N))

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

Solution (Python):


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

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

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

Solution (Python):



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


if __name__ == "__main__":
    main()

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    ans = 'Yes'
    n = int(input())
    if n%9 != 0:
        ans = 'No'
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
n = input()

nlist = [int(i) for i in n]
t = sum(nlist)

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

Solution (Python):
n = input()

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

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

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

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

Solution (Python):
char = input()

num = 0
for c in char:
    num += int(c)
if num%9 == 0:
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
import copy
import math
import time
import statistics
import math
import itertools
import bisect
import sys
from decimal import *
from collections import deque


def get_int():
    return int(input())

def get_string():
    return input()

def get_int_list():
    return [int(x) for x in input().split()]

def get_string_list():
    return input().split()

def get_int_multi():
    return map(int, input().split())

def get_string_char_list():
    return list(str(input()))



sys.setrecursionlimit(10 ** 6)

def main():
    start = time.time()

    n = get_string()

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

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




    

    


if __name__ == '__main__':
    main()

Solution (Python):
sums = sum([int(x) for x in input()])
print("Yes" if sums % 9 == 0 else "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()
ans = ['No', 'Yes'][(sum([int(e) for e in N]) % 9) == 0]
print(ans)

Solution (Python):
import math

n, = [int(i) for i in input().split(' ')]

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

print(ret)

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

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

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

Solution (Python):
N = input()

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

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

Solution (Python):
N = input()

arr = [int(i) for i in  list(N)]

if sum(arr) % 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):
import sys
input = sys.stdin.readline
N = int(input())
if N%9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
def main():
    num = 0
    MOD = 9
    N = list(map(int, list(input())))

    for d in N:
        num += d
        num %= 9
    
    if num:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()

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

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

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

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

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


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

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

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

list_N = list(str(N))
check = 0

for i in range(len(list_N)):
    check += int(list_N[i])

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

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

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

Solution (Python):


n = str(input())

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

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

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

Solution (Python):




N = input()

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

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

Solution (Python):

a = input()

x = 0

for i in a:
    x += int(i)

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

Solution (Python):
S = input().strip()
ans = 0

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

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

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N = input().strip("\n")
    total = 0
    for i in range(len(N)):
        total += int(N[i])
        total %= 9
    if total == 0: print("Yes")
    else: print("No")

    return 0

if __name__ == "__main__":
    solve()

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

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


if __name__ == "__main__":
    main()

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

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

else:
  print('No')

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

Solution (Python):
from collections import defaultdict,deque
import math
def main():
    n = input()
    tmp = 0
    for i in range(len(n)):
        tmp += int(n[i])
        tmp%=9
    if(tmp%9==0):
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()

Solution (Python):
N = input()

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

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

Solution (Python):
N = input()

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

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

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

Solution (Python):
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N = input()
    ninesum = 0
    for i in N:
        ninesum += int(i)
    if ninesum % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()

Solution (Python):
n = input()

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

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

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

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

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

Solution (Python):
import sys

n = sys.stdin.readline()[:-1]
v = sum([
    int(i)
    for i in n
])

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

Solution (Python):
n = input()

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

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

print(ans)

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

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

Solution (Python):
n=input()

l=len(n)

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

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

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
S = [str(x) for x in input()]
res = 0
for s in S:
    res += int(s)
if res % 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):
n = input()
print('Yes' if sum([int(nn) for nn in n]) % 9 == 0 else 'No')

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
def main():
    n = map(int, list(input()))
    ret = 0
    for i in n:
        ret += i
        ret %= 9
    if ret == 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Solution (Python):
N = input().strip("¥n")

summ9= 0

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

Solution (Python):
N = input()

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

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

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

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

Solution (Python):
N = input()

n = list(N)

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

s = sum(n)

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

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

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

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

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

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

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

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

Solution (Python):
n = str(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):
print('YNeos'[int(input())%9>0::2])

Solution (Python):

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

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

Solution (Python):
N = input()

k = [ int(num) for num in N]
ans = 'Yes' if sum(k)%9==0 else 'No'

print(ans)

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

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

s = str(N)
sum = 0
for c in s:
    sum += int(c)

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

Solution (Python):


N=input()
S=0
for n in N:
    S+=int(n)

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

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    s = list(input())
    sum = 0
    for i in s:
        I = int(i)
        sum += I
    if sum % 9 == 0:
        print('Yes')
    else:
        print('No') 

    

    
if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys
from io import StringIO
import unittest
import os


sys.setrecursionlimit(999999999)



def resolve(test_def_name=""):
    n_s = list(input())

    ans = 0
    for n in n_s:
        ans += int(n)

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



class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """123456789"""
        output = """Yes"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """0"""
        output = """Yes"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """31415926535897932384626433832795028841971693993751058209749445923078164062862089986280"""
        output = """No"""
        self.assertIO(test_input, output)

    
    def test_original(self):
        pass



if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        
        resolve()

    else:
        
        unittest.main()

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

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

Solution (Python):
N=int(input())
s = str(N)
array = list(map(int, s))
N_sum=sum(array)
if N_sum%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])
  
if sums % 9 == 0:
  print("Yes")
else:
  print("No")

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

Solution (Python):
import sys
import numpy as np
import math  
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate 
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache 

def main():
    n = list(input())
    ans = 0
    for i in n:
        ans += int(i)
        if ans >= 9:
            ans -= 9
    if ans == 0 or ans % 9 == 0:
        print('Yes')
    else: print('No')
    
    return 0

if __name__ == "__main__":
    main()

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

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

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

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

if __name__ == '__main__':
    print(main())

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

Solution (Python):
list1 = list(map(int, input().split()))
Sum = 0
for x in list1:
    Sum += x
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):
s=0
for ni in input():
  s+=int(ni)

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

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

tmp = 0

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

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

Solution (Python):

"""
Created on Sat Aug 22 21:03:45 2020

@author: NEC-PCuser
"""

N = input()

sum_c = 0
for c in N:
	sum_c += int(c)

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

tmp = 0
for i in list_N:
    i = int(i)
    tmp += i

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

else:
    print("No")

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

Solution (Python):

def main():
    N = input()

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
N = input()

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

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

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

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

    ans = 0
    for i in a:
        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):
a = input()
count = 0
for i in range(len(a)):
    count += int(a[i])


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

Solution (Python):
n = input()

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

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

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

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

Solution (Python):



import sys


def std_in():
    return sys.stdin.readline().strip()


def main():
    n = int(std_in())
    if n % 9 == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
import sys,math
try:sys.stdin,sys.stdout=open('input.txt','r'),open('out.txt','w')
except:pass
from time import clock
a=clock()
from sys import stdin,stdout;mod=int(1e9 + 7);from statistics import mode
from collections import *;from math import ceil,floor,inf,factorial,gcd,log2,sqrt,log
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()


def lcm(a,b): return (a*b)//gcd(a,b)
def setbits(n):return bin(n).count('1')
def resetbits(n):return bin(n).count('0')
def modinv(n,p):return pow(n,p-2,p)
def ncr(n,r):
    num,den=1,1;r=min(n,n-r)
    for i in range(r):num*=(n-i);den*=(i+1)
    return num//den
def ncr_p(n, r, p):
    num,den=1,1;r=min(r,n-r)
    for i in range(r):num = (num * (n - i)) % p ;den = (den * (i + 1)) % p
    return (num * modinv(den,p)) % p
def isPrime(num) :
    if num<=1:return False
    if num==2 or n==3:return True
    if (num % 2 == 0 or num % 3 == 0) :return False
    m = int(num**0.5)+1
    for i in range(5,m,6):
        if (num % i == 0 or num % (i + 2) == 0) :return False
    return True
def bin_search(s, low, high, val):
    while low <= high:
        mid = low + (high - low) // 2;
        if s[mid] == val:return mid
        elif s[mid] < val:low = mid + 1
        else:high = mid - 1
    return -1
def sumofdigit(num):
    count=0;
    while num : count+=num % 10;num //= 10;
    return count;
def inputmatrix():
    r,c=iia();mat=[0]*r;
    for i in range(r):mat[i]=iia();
    return r,c,mat;
def prefix_sum(n,s):
    for i in range(1,n):s[i]+=s[i-1]
    return s;
def binomial(n, k):
    if 0 <= k <= n:
        ntok = 1;ktok = 1
        for t in range(1, min(k, n - k) + 1):ntok *= n;ktok *= t;n -= 1
        return ntok // ktok
    else:return 0
def divisors(n):
    res = [];
    for i in range(1,ceil(sqrt(n))+1):
        if n%i == 0:
            if i==n//i:res.append(i)
            else:res.append(i);res.append(n//i)
    return res;

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

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

Solution (Python):
n = input()

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

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

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

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

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

if __name__ == '__main__':
    main()

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

Solution (Python):

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

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

ans = 0
for c in n:
    ans += int( c )
    ans = ans % 9

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

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

Solution (Python):
def resolve():
    '''
    code here
    '''

    N = input()

    sum_num = 0
    for item in N:
        sum_num += int(item)

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

if __name__ == "__main__":
    resolve()