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

Solution (Python):
num = input()
lst = []
for x in num:
    lst.append(int(x))

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

Solution (Python):
S = input()

cnt = 0
for ch in S:
  cnt += int(ch)
  
if cnt % 9 == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
N = input()
len_N = len(N)
count = 0

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    S = input()
    n = 0
    for s in S:
        n += int(s)
    if n%9 == 0:
        print("Yes")
    else:
        print("No")


if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    S = input()
    n = 0
    for s in S:
        n += int(s)
    if n%9 == 0:
        print("Yes")
    else:
        print("No")


if __name__=='__main__':
    main()

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

Solution (Python):
n = input()

ret = 0

for s in n:
    ret *= 10
    ret %= 9
    ret += int(s)
    ret %= 9

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

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

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

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

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

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

SUM = sum(list(map(int, str(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()

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

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

Solution (Python):
num = list(input().split())

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

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

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

Solution (Python):
n=int(input())
ans=n%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):
'''

                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.

'''

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

Solution (Python):

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

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

Solution (Python):
from sys import stdin
from math import ceil
inp = lambda : stdin.readline().strip()

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

Solution (Python):
from sys import stdin
import math
inp = lambda : stdin.readline().strip()

a = list(inp())
a2 = [int(x) for x in a]
if sum(a2) % 9 == 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())
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):
ans = int(input()) % 3 == 0
if ans:
  print('Yes')
else:
  print('No')

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

Solution (Python):
N = int(input())
n = str(N)
a = list(n)

count = 0

for i in range(len(a)):
  count = count + int(a[i])

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

Solution (Python):
N = input()

Sum = 0
for n in list(N):
    Sum = Sum + int(n)

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

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

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

Solution (Python):
N = map(int,input().split())
if (sum(N) % 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):
num = input()

ans = 0

for digit in num:
    ans += int(digit)

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

else:
    print("No")

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

S = sum(lst)

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

Solution (Python):
d = input()

s = 0

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

Solution (Python):
n=input()

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

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

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

Solution (Python):
def solve(s):
  suma = 0
  for x in s:
    suma += int(x)
  if suma % 9 == 0:
    return True
  return False

s = input()
x = solve(s)
if x == True: print("Yes")
else: print("No")

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

Solution (Python):
N = input()
lenN = len(N)
sumN = 0

for x in N:
    sumN += int(x)
    if sumN > 9:
        sumN %= 9
if sumN % 9 == 0:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
K=str(input())
SUM=0

for i in range(len(K)):
  SUM+=int(K[i])

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

Solution (Python):
N = input()
s = len(N)
sum = 0

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

Solution (Python):
def func(N):
  strN = str(N)
  sum = 0
  for s in strN:
    sum += int(s)
  return "Yes" if sum % 9 == 0 else "No"

if __name__ == "__main__":
  N = str(input())
  print(func(N))

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

Solution (Python):

strN = input()
s = 0
for c in strN:
  s += int(c)

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

Solution (Python):
t = int(input())
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(input())
n = [int(num) for num in N]
s = sum(n)

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

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

Solution (Python):
def sum_i(N):
    return sum(list(int(i) for i in str(N)))


print("No") if sum_i(input()) % 9 else print("Yes")

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

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

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

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

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

Solution (Python):
a = 0
for c in map(int, input()):
    a += c
print("Yes" if a % 9 == 0 else "No")

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

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

Solution (Python):

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

Solution (Python):
N = input()

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

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

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

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

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

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

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

N_sum = sum(N)

if N_sum%9 == 0:
    print('Yes')

else:
    print('No')

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

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

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

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):
N = input()
nums = []

for num in N:
    nums.append(int(num))

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

Solution (Python):
N = str(input())
 
a = []
for n in range(len(N)):
  a.append(int(N[n]))
  
if sum(a) % 9 == 0:
  print('Yes')
else:
  print('No')

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

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

Solution (Python):
N = input()

tmp = 0
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):
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):
'''
Problem Link - https://atcoder.jp/contests/abc176/tasks/abc176_b
'''
from sys import stdin,stdout
from math import *
from collections import *

mod = 1000000007

def gcd(a,b):
	while b:
		a,b = b,a%b
	return a

def lcm(a,b): return (a*b) // gcd(a,b)

def set_bits(X):
	c = 0
	while X:
		X &= (X-1);c += 1
	return c

def compute_MOD(N,M): return (N%M + M) % M

def get_array(): return list(map(int, stdin.readline().split()))
 
def get_ints(): return map(int, stdin.readline().split())

def get_int(): return int(stdin.readline())

def get_input(): return stdin.readline().strip()

def main():
	N = get_input()
	Sum = 0
	for i in N:Sum+=int(i)
	if Sum%9==0:stdout.write('Yes\n')
	else:stdout.write('No\n')
	

if __name__ == "__main__":
    main()

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

Solution (Python):
N = input()

S = sum(int(d) for d in N)

print("Yes" if S % 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 = int(input().split()[0])
ans = "Yes" if sum([int(i) for i in list(str(N))]) % 9 == 0 else "No"

print(ans)

Solution (Python):


N = str(input())

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

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np
from math import ceil as C, floor as F, sqrt
from collections import defaultdict as D, Counter as CNT
from functools import reduce as R
import heapq as HQ

class Heap:
  def __init__(self, data, reverse=False):
    self.reverse = -1 if reverse else 1
    self.data = [self.reverse * d for d in data]
    HQ.heapify(self.data)
  def push(self, x): return HQ.heappush(self.data, self.reverse * x)
  def pop(self): return self.reverse * HQ.heappop(self.data)

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def Ss(): return list(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

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

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

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

Solution (Python):




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

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

while len(n) > 1: 
  tmp = sum(n)
  n = list(map(int, list(str(tmp))))

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

Solution (Python):
s = input()
acm = 0

for i in s:
    acm = (acm + ord(i)-ord('0'))%9

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

Solution (Python):
input_ = input()
sum_ = 0
for i in input_:
  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):
from functools import reduce
print('Yes') if reduce(lambda x, y: x + y, map(int, list(input()))) % 9 == 0 else print('No')

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

Solution (Python):
print('Yes' if sum(list(map(int, input()))) % 9 == 0 else '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):
num = input()
le = len(num)
sum=0
for i in range(le):
  sum += int(num[i])
if sum%9==0:
  print("Yes")
else:
  print("No")

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

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

Solution (Python):
n = int(input())
n_s = str(n)
m = 0
for i in range(len(n_s)):
    m += int(n_s[i])
    m = m % 9

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

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

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

Solution (Python):


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  
from itertools import combinations as comb  
from itertools import permutations as permutate
from bisect import bisect_left as bl



from bisect import bisect_right as br
from bisect import bisect







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


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)





from types import GeneratorType


def iterative(f, stack=[]):
    def wrapped_func(*args, **kwargs):
        if stack: return f(*args, **kwargs)
        to = f(*args, **kwargs)
        while True:
            if type(to) is GeneratorType:
                stack.append(to)
                to = next(to)
                continue
            stack.pop()
            if not stack: break
            to = stack[-1].send(to)
        return to

    return wrapped_func







mod = 1000000007


def inp(): return sys.stdin.readline().rstrip("\r\n")  

def out(var): sys.stdout.write(str(var))  

def lis(): return list(map(int, inp().split()))

def stringlis(): return list(map(str, inp().split()))

def sep(): return map(int, inp().split())

def strsep(): return map(str, inp().split())


def zerolist(n): return [0] * n

def nextline(): out("\n")  

def testcase(t):
    for p in range(t):
        solve()

def printlist(a):
    for p in range(0, len(a)):
        out(str(a[p]) + ' ')


def solve():
    s=inp()
    a=0
    for i in s:
        a+=int(i)
    if a%9==0:
        print("Yes")
    else:
        print("No")

    
    
    
solve()

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

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

Solution (Python):
s = input()
N = [int(c) for c in s]
add = 0

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

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

Solution (Python):
N = input()
ans = 0


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

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

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

Solution (Python):
N = input()

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

Solution (Python):
if __name__ == "__main__":
    N = input()
    n_list = []

    for n in N:
        n_list.append(int(n))

    n_sum = sum(n_list)

    ans = 'Yes' if n_sum % 9 == 0 else 'No'

    print(ans)

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

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

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

nums = [int(s) for s in l]

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

Solution (Python):
N = str(input())
bruh = 0
for i in N :
    bruh += int(i)
if bruh %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):
x = input()
s = 0

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

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

Solution (Python):
N = input()

sum = 0

for i in range(10):
    sum += N.count(str(i)) * i

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

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

Solution (Python):
count = input()

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    N = list(input().rstrip())
    ans = 0
    for n in N:
        ans += int(n)
    if ans%9 == 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N=map(int,input())
    
    add = sum(list(N))
    if add%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 = int(input())

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

Solution (Python):
import math
import numpy as np
import numba
from numba import njit, b1, i4, i8, f8
from numba import jit
import collections
import bisect
from collections import deque
from copy import copy, deepcopy
import time
 
def main():
    N = input()
    sum = 0
    for n in N:
        sum+=int(n)
    print("Yes" if sum%9==0 else "No")

if __name__ == '__main__':
    main()

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=sum+int(N[i])

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

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

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

Solution (Python):
import sys


def resolve(in_):
    _N = next(in_).strip()
    N = map(int, _N)
    s = sum(N)
    return 'Yes' if s % 9 == 0 else 'No'


def main():
    answer = resolve(sys.stdin)
    print(answer)


if __name__ == '__main__':
    main()

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 = 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()
total = 0
for i in range(10):
    total += n.count(str(i)) * i
if total % 9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
n = input()

ls = list(n)

wa = 0
for i in range(len(ls)):
    wa += int(ls[i])


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

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

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

Solution (Python):
n = input()

res = 0

for e in n:
    res += int(e)

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: str):
    B = [0]

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

        B.append(T)

    A = B[len(N)] - B[0]

    if A % 9 ==0:
        return print(YES)
    else:
        return print(NO)



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

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

print("Yes") if(num % 9 == 0) else print("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):
print("YNeos"[(int(input()) % 3 != 0)::2])

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

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

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

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

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

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

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

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

array = list(map(int, s))

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 = int(input())
sumOfN = sum(int(i) for i in list(str(n)))
print("No" if sumOfN%9 else "Yes")

Solution (Python):
print(["No", "Yes"][int(input()) % 9 == 0])

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

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

if cnt%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 % 3 == 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(input())
a=0
for i in n:
  a+=int(i)
if a%9==0:
  print('Yes')
else:
  print('No')

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

Solution (Python):
str=input()
l=len(str)
n=0
while l>0:
    n=n+int(str[l-1])
    l=l-1
if n%9 == 0:
    print("Yes")
else :
    print("No")

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

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

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

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

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

Solution (Python):
from sys import stdin



test = list(stdin.readline().rstrip())
 
result=0
 
for i in test:
  result = result + int(i)
 
if (result % 9) == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
A = input()
total = 0
for i in A:
    total += int(i)

if total % 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 = int(input())

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

Solution (Python):
from functools import reduce

print("Yes" if reduce(lambda a, b: (a+b)%9, map(int, input()), 0) == 0 else "No")

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

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

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

Solution (Python):
from sys import stdin

test = list(stdin.readline().rstrip())
 
result=0
 
for i in test:
  result = result + int(i)
 
if (result % 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
import math

test = list(stdin.readline().rstrip())

result=0

for i in test:
  result = result + int(i)

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

Solution (Python):
import math
n = sum([int(x) for x in str(input()).split()])

a, b = divmod(n, 9)

print("No" if b else "Yes")

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

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

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