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

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

if __name__ == "__main__":
    main()

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

for num in N:
    N_sum += int(num)

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

Solution (Python):
import os
import sys
from io import BytesIO, IOBase


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



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


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
    main()

Solution (Python):
N = input()
x = len(N)
counter = 0
for i in range(x):
  counter = (counter + int(N[i])) % 9

print("Yes" if counter == 0 else "No")

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

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

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

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

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

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

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

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

l=len(n)

ck=0

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

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

Solution (Python):
N = input().split()

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

if tmp == 0:
    print("Yes")
    exit()

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

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

Solution (Python):
def read():
    N = int(input())
    return N


def func(N):
    return sum(map(int, list(str(N)))) % 9 == 0


if __name__ == '__main__':
    N = read()
    print('Yes' if func(N) else 'No')

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

Solution (Python):








N = input()

ans = 0

for s in N:
    ans += int(s)

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

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

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

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


def main():
    s = si()[:-1]
    n = 0
    for c in s:
        n += int(c)
    if not n % 9:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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):
S = input()
sum = 0
for s in S:
    sum += int(s)

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

Solution (Python):
N = input()

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

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

Solution (Python):


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

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

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

Solution (Python):
N = input()

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

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

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

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

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

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

sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

from collections import defaultdict
sys.setrecursionlimit(10**7)
import math








INF = 1 << 50



def run():
    N = input()
    val = 0
    for n in N:
        val += int(n)
    if not val % 9:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    run()

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

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

for d in n:
  mod = (mod + int(d)) % 9
  
if mod == 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):
N = input()
print('Yes' if sum(map(int, N)) % 9 == 0 else 'No')

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

Solution (Python):
import math
import numpy as np
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


N = I()
S = str(N)
S_sum = 0
for s in S:
    S_sum += int(s)

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

Solution (Python):
import math

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

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

resolve()

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

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

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

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

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

if n % 9 == 0 and sum(map(int, str(n).split())) % 9 == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def input(): return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    s = sum(map(int, [i for i in str(N)]))
    if s % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys
s = sys.stdin.readline().rstrip("\n")
ans = 0
for n in s:
    ans += int(n)
    ans = ans % 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):
N = str(input())
array = list(map(int, N))
N_sum = sum(array)

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

Solution (Python):
N = input()

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

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

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

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

tot = 0

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

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

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

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

Solution (Python):
n = input()

sum = 0

for c in n:
    sum = sum + int(c)

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

Solution (Python):
n = input()

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

if sum_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):
from math import ceil


def A(n, x, t):
  return ceil(n / x) * t


def B(n_str):
  s = 0
  for c in n_str:
    s += int(c)
  if s % 9 == 0:
    return 'Yes'
  return 'No'


def main():
  
  
  n_str = input()
  print(B(n_str))


if __name__ == '__main__':
  main()

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

Solution (Python):
from sys import stdin

def main():
    moji = input()

    s = 0
    for m in moji:
        s += int(m)


    if s == 0:
        print("Yes")
        exit()

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

if __name__ == "__main__":
    main()

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

Solution (Python):
N=input()

n=len(N)

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

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

Solution (Python):
import sys

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

s = S()
count = 0
for i in s:
    count += int(i)

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

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

resolve()

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 time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

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

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()



N = In.str()

ans = 0

for num in N:
    ans += int(num)
    ans %= 9

if ans==0:
    Out.str("Yes")
else:
    Out.str("No")



if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

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

Solution (Python):
import math
import sys,collections
from sys import stdin, stdout  


def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_string(): return sys.stdin.readline().strip() 
def input(): return sys.stdin.readline().strip()

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 
def is_subsequence(x, y):
    """Test whether x is a subsequence of y"""
    x = list(x)
    for letter in y:
        if x and x[0] == letter:
            x.pop(0)

    return not x    
def sieve(): 
	spf[1] = 1
	for i in range(2, MAXN): 
		spf[i] = i 
	for i in range(4, MAXN, 2): 
		spf[i] = 2

	for i in range(3, mt.ceil(mt.sqrt(MAXN))): 
		if (spf[i] == i): 
			for j in range(i * i, MAXN, i): 
				if (spf[j] == j): 
					spf[j] = i 
def getFactorization(x): 
	ret = list() 
	while (x != 1): 
		ret.append(spf[x]) 
		x = x // spf[x] 

	return ret 
def getFloor(A, x):

    (left, right) = (0, len(A) - 1)

    ind,floor = -1,-1
    while left <= right:
        mid = (left + right) // 2
        '''if A[mid] == x:
            return mid'''
        if x < A[mid]:
            right = mid - 1
        else:
            floor = A[mid]
            ind=mid
            left = mid + 1
            
    return ind
def check(st) : 
  
    
    n = len(st) 
    digitSum = 0
      
    for i in range(0,n) : 
        digitSum = digitSum + (int)(st[i]) 
  
    
    
    return (digitSum % 9 == 0)     


mod=(10**9)+7

def main():
	a=input()
	if(check(a)):
		print("Yes") 
	else:
		print("No") 

	





















	




















		
			


		

			

		





			

	























				

	















	

	










if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
if n%9 ==0:
    print('Yes')
else:
    print('No')

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

ans = 0

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

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

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

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

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

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

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

def digitSum(n):
    
    s = str(n)
    
    array = list(map(int, s))
    
    return sum(array)

b = digitSum(a)

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

Solution (Python):
N = input()

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

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

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

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

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

Solution (Python):
def main(n):
	summ = 0
	for i in n:
		summ += int(i)
	if summ % 9 == 0: return "Yes"
	else: return "No"
	

n = input()
print(main(n))

Solution (Python):

n = input()
ans = 'Yes'

s = 0
for i in n:
    s += int(i)
if s%9!=0: ans='No'
print(ans)

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

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

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

Solution (Python):
n = input()


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

Solution (Python):
n = sum([int(_) for _ in list(str(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(_) for _ in input()]
if sum(n)%9==0:
    print("Yes")
else:
    print("No")

Solution (Python):
import numpy as np
N = np.array(list(str(input()))).astype(np.int8)
N = np.sum(N)
if N%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()

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().split()))
s = sum(N)
print('Yes' if s % 9 == 0 else 'No')

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

Solution (Python):

"""
Created on Sat Aug 15 17:00:46 2020

@author: saito
"""






N = input()


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



print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = str(int(readline()))
l = [int(i) for i in list(n)]
print('Yes' if sum(l)% 9 == 0 else 'No')

Solution (Python):
from collections import defaultdict
from collections import deque
from collections import Counter
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

x = sum(list(map(int, input().split())))

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

Solution (Python):
import sys
read = sys.stdin.readline
import time
from heapq import heappush, heappop, heapify
import math
import itertools as it
def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
start_time = time.perf_counter()


N = input()

ans = 0
for s in N:
    i = int(s)
    ans += i

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


end_time = time.perf_counter()
print('time:', end_time-start_time, file=sys.stderr)

Solution (Python):
N = list(map(int,input().split()))
a = 0
for i in range(len(N)):
    a += N[i]
if a % 9 == 0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
N = input()
import numpy as np

N_list = list(N)
N_array = np.array(N_list).astype(int)

if np.sum(N_array) % 9 ==0:
    print('Yes')

else:
    print('No')

Solution (Python):
N = int(input())
sum_N = 0
S = str(N)

for i in range(len(S)):
  sum_N += int(S[i])
  
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):


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


if __name__ == "__main__":
    main()

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

Solution (Python):
n=str(input())
def nine(n):
  res=0
  for i in n:
    res+=int(i)
    res%=9
  return res
if nine(n)==0:
  print('Yes')
else:
  print('No')

Solution (Python):
N=input()
l=list(N)
p=[int(a) for a in l]
w=sum(p)
if w%9==0:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: str):
    s = 0
    for i in N:
        s += int(i)


    if s %9 ==0 :
        print(YES)
    else:
        print(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_all = 0

for cnt in range(len(n)):
    cnt_all += int(n[cnt])

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

Solution (Python):
s = input()

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

Solution (Python):
s = input()

sum = 0

for x in s:
    sum += int(x)

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

Solution (Python):
s=input()

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

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

Solution (Python):
import sys
import math
import bisect
from sys import stdin,stdout
from math import gcd,floor,sqrt,log
from collections import defaultdict as dd
from bisect import bisect_left as bl,bisect_right as br

sys.setrecursionlimit(100000000)

ii     =lambda: int(input())
si     =lambda: input()
jn     =lambda x,l: x.join(map(str,l))
sl     =lambda: list(map(str,input().strip()))
mi     =lambda: map(int,input().split())
mif    =lambda: map(float,input().split())
lii    =lambda: list(map(int,input().split()))

ceil   =lambda x: int(x) if(x==int(x)) else int(x)+1
ceildiv=lambda x,d: x//d if(x%d==0) else x//d+1

flush  =lambda: stdout.flush()
ssi =lambda: stdin.readline()
sii =lambda: int(stdin.readline())
sp  =lambda x: stdout.write(str(x))

mod=1000000007



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

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

Solution (Python):

import glob
import os

bn = os.path.basename(__file__).split('.')[0]
dn = os.path.dirname(__file__).split('/')


REL_PATH = dn[len(dn)-2] + '\\' + dn[len(dn)-1] + '\\' + bn


TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        N = self.input_data()

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

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



solver = Solver(REL_PATH)
solver.exec_resolve()

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

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

Solution (Python):
N = input()

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

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

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

n = len(s)

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

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

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

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

main()

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

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

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

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

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

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

Solution (Python):
n = input()

t = n[0]
for i in range(1,len(n)): t += "+" + n[i]
if int(n)%9 == 0 and eval(t)%9 == 0: print("Yes")
else: print("No")

Solution (Python):
N = input()

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

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

Solution (Python):
from functools import reduce
from operator import add
N = map(int, list(input()))
ans = reduce(add, N)
print("Yes" if ans%9==0 else "No")

Solution (Python):

from collections import defaultdict
import sys

N = input()

s  = 0

for c in N:
    s += int(c)

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

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

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

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

    else :
        print("No")


if __name__ == "__main__":
    solve()

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

Solution (Python):
import sys

S = str(input())

Sum = 0

for i in range(len(S)):
    Sum += int(S[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])
    s%=9

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

Solution (Python):
class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N = input()

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n = str(input())
l = len(n)
c = 0

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

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

Solution (Python):
N = input()

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

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

A = [int(s) for s in S]

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

Solution (Python):
A = input()

sum = 0
for a in A:
  sum += int(a)

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