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-----
123456789

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

Solutions:
L=input()
r=0
for l in L:
	r+=int(l)
print('Yes' if r%9==0 else 'No')

a=int(input())
b=str(a)
c=list(map(int,b))
d=sum(c)
if d%9==0:
    print('Yes')
else:
    print('No')



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

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

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

N=input()
list=[]
t=0
for i in range(len(N)):
    list.append(N[i])
for i in range(len(list)):
    t=t+int(list[i])
if t%9==0:
    print('Yes')
else:
    print('No')

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


N=list(input())
sum=0

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

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

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

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


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

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

n = input()
L = len(n)
s = 0

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

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

nums = list(map(int, input()))
num_len = len(nums)
sums = 0

for i in range(num_len):
    sums += nums[i]

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

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

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

N = str(input())
N_list = list(N)
ans = 0

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

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

n_l = list(str(input()))

sum_num = 0
for i in n_l:
    sum_num += int(i)

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

import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

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

N=input()

s=0

for i in range(0,len(N)):

	s+=int(N[i])

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

def multiple_of_nine():
    # 入力
    N = int(input())
    # 処理
    if N % 9 == 0:
        return 'Yes'
    else:
        return 'No'

result = multiple_of_nine()
print(result)


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

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

# coding: utf-8
# Your code here!
def main():
    num = sum(list(map(lambda x:int(x), input())))
    if num % 9 == 0:
        print("Yes")
    else:
        print("No")

def __starting_point():
    main()
__starting_point()

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

s = input()

sum = 0
for c in s:
	sum += ord(c) - ord('0')

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


N = int(input())

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

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

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

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


N = input()
N_digit_sum = sum(int(n) for n in N)
print("Yes" if N_digit_sum%9 == 0 else "No") # (๑•ૅㅁ•๑)

N = str(input())

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

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

import sys

N = list(input())

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

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

import sys


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


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


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


def __starting_point():
    main()

__starting_point()

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

# -*- coding: utf-8 -*-
n=str(input())
s=len(n)
h=0
for i in range(s):
  keta=int(n[i])
  h+=keta
if h%9==0:
  print('Yes')
else:
  print('No')

numero = input()
soma = 0

for n in numero:
    soma += int(n)

print(f"{'Yes' if  soma%9 == 0 else 'No'}")

n = input()
wa=0
for i in range(0,10):
    wa = wa + n.count(str(i))*i
print('Yes' if wa%9==0 else 'No') 

N=int(input())

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


n = input()
length = len(n)
ans=0

for i in range (length):
  ans +=int(n[i])

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

N = int(input())
my_str = str(N)
my_sum = 0
for i in my_str:
    my_sum += int(i)
print(('Yes' if my_sum % 9 == 0 else 'No'))

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


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

N = str(input())
num = list(N)
natural_num = list(map(int, num))
K = len(natural_num)
L_num = 0
for i in range(K):
    L_num += natural_num[i]
ans = L_num % 9
if ans == 0:
    print('Yes')
else:
    print('No')

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

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

n = int(input())

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

n = int(input())

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

n = list(map(int,input().split()))
ans = "Yes"
if sum(n)%9:
    ans = "No"
print(ans)

n = input()

if(len(n) <= 7):
	if(int(n) % 9 == 0):
		print("Yes")
	else:
		print("No")
else:
	sum = 0
	for i in n:
		sum = sum + int(i)
	if(sum % 9 == 0):
		print("Yes")
	else:
		print("No")

p=input()
if p=='0':
  print('Yes')
elif len(p)==1 and p!='9':
  print('No')
elif len(p)==1 and p=='9':
  print('Yes')
else:
  if sum([int(val) for val in p])%9==0:
    print('Yes')
  else:
    print('No')


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

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

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

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


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

import numpy as np
a = np.array(list(map(int, list(input()))), dtype=np.int64).sum() % 9 == 0
if a:
    print("Yes")
else:
    print("No")


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

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

print("YNeos"[sum(map(int,input()))%9>0::2])

N = input()
sum_N = 0

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

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

s=input()
n=len(s)

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

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

def answer(n: str) -> str:
    result = 0
    for i in n:
        result += int(i)

    return 'Yes' if result % 9 == 0 else 'No'


def main():
    n = input()
    print((answer(n)))


def __starting_point():
    main()

__starting_point()

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



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

N = input()
nums = []
length = len(N)
for i in range(1, length+1):
    value = int(N[-i])
#     print(value)
    nums.append(value)
sumOfNums = sum(nums)
if sumOfNums % 9 == 0:
    print('Yes')
else:
    print('No')

def b176(n):

    intn = [int(i) for i in n]

    return "Yes" if sum(intn) % 9 == 0 else "No"


def main():
    n = list(str(input()))
    print(b176(n))

def __starting_point():
    main()
__starting_point()

# -*- coding utf-8 -*-

MOD = 10 ** 9 + 7

N = input()

ans = 'Yes' if sum(map(int, N)) % 9 == 0 else 'No'

print(ans)


N=int(input())

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

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

N=int(input())
M=str(N)
a=[0]*len(M)
S=0
for i in range(len(M)):
  a[i]=int(M[i])
  
for j in a:
  S=S+j
  
if S%9==0:
  print("Yes")
else:
  print("No")

n = input()

ans = 0

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

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


import re
import sys

#Lista de Entradas
lst = []
for line in sys.stdin:
    lst.append(line.rstrip("\n"))


regex = [[int(r) for r in re.findall("(\d+)",line)]
            for line in lst]

verifica = lambda x: "Yes" if x % 9 == 0 else "No" 

[print(verifica(r[0])) for r in regex]

N=input()

def ans176(N:str):
    sum=0
    for i in range(len(str(N))):
        sum+=int(str(N)[i])
    if sum%9==0:
        return("Yes")
    else:
        return("No")

print(ans176(N))

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

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

n = int(input())

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

x = input()

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

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


n = list(input())
x = 0

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

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


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

def answer(n: str) -> str:
    return 'Yes' if sum(map(int, n.split())) % 9 == 0 else 'No'


def main():
    n = input()
    print((answer(n)))


def __starting_point():
    main()

__starting_point()

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

N = int(input())

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

temp = input()
temp = list(temp)
num_list = [int(s) for s in temp]
sum = 0
for i in range(len(num_list)):
  sum += num_list[i]
if(sum % 9 == 0):
  print('Yes')
else:
  print('No')

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

def main():
    
    try:
        N = input()
            
        a = list(N)
        s = 0
        
        for i in range(len(a)):
            s += int(a[i])
        
        print("Yes" if s % 9 == 0 else "No")
        
    except EOFError:
        print("No")
    
def __starting_point():
    main()
__starting_point()

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


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

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


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

N = input()

n = list(map(int, N))

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

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

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

n = int(input())

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


print("YNeos"[sum(map(int,input()))%9>0::2])

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

N = input()
S = 0
for i in N:
    S += int(i)
if S == 0:
    print('Yes')
elif S < 9:
    print('No')
elif S % 9 == 0:
    print('Yes')
else:
    print('No')


N = input()
n = len(N)
total = 0

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

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


from sys import stdin
N = list(stdin.readline().rstrip())
d_sum = 0
for n in N:
    d_sum += int(n)
if d_sum % 9 == 0:
    print('Yes')
else:
    print('No')

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

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