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: EASY

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


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


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


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


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


print('No' if sum([int(x) for x in input()]) % 9 else 'Yes')


x = input()
x = list(x)
sum = 0
for i in x:
	sum += int(i)
if sum % 9 == 0:
	print('Yes')
else:
	print('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')


MOD = 10 ** 9 + 7
N = input()
ans = 'Yes' if sum(map(int, N)) % 9 == 0 else 'No'
print(ans)


N = list(input())
N_2 = list(map(int, N))
print('YNeos'[sum(N_2) % 9 != 0::2])


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


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


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


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


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


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


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


print('Yes' if sum(map(int, input())) % 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')


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


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


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


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


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


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


N = list(input())
print(['No', 'Yes'][sum((int(T) for T in N)) % 9 == 0])


numero = input()
soma = 0
for n in numero:
	soma += int(n)
print(f"{('Yes' if soma % 9 == 0 else '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()


s = sum(map(int, list(input())))
print(s % 9 == 0 and 'Yes' or '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 = input()
a = 0
for n in N:
	a += int(n)
print('Yes' if a % 9 == 0 else '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')


print(['No', 'Yes'][sum((int(c) for c in input())) % 9 == 0])


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


print('NYoe s'[sum([int(i) for i in input()]) % 9 == 0::2])


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


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


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


s = 0
for x in input():
	s = (s + int(x)) % 9
print('YNeos'[s > 0::2])


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


print(['No', 'Yes'][sum([int(_) for _ in input()]) % 9 == 0])


s = input()
cnt = 0
for i in s:
	cnt += int(i)
print(['No', 'Yes'][cnt % 9 == 0])


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


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


print('YNeos'[sum((int(i) for i in input())) % 9 > 0::2])


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


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


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')
elif sum([int(val) for val in p]) % 9 == 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')


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


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


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


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