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



Sample input:
123456789


Sample output:
Yes

Submission status: Accepted

Solution code:
def main():
    n = input()
    ans = 0
    for elem in n:
        ans = (ans + int(elem))%9
    print("Yes" if ans % 9 == 0 else "No")
        
    
        
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

Solution code:
n = input()
k=0
for i in n:
    k+=int(i)
    k%=9

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
n = input()
num = [int(i) for i in n]

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

Submission status: Accepted

Solution code:
from collections import defaultdict
import numpy as np

if __name__ == '__main__':
    s = input()
    count = 0
    for elem in s:
        count += int(elem)

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

Submission status: Accepted

Solution code:
n = input()
a = [int(c) for c in n]
b = sum(a)
if b%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
N_sum = 0

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

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

Submission status: Accepted

Solution code:
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")

# region fastio

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

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

N = input()

ans = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=list(str(input()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
N = input()

s = 0

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

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

Submission status: Accepted

Solution code:
S = input()
sum = 0
for s in S:
    sum += int(s)

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

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = 0

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

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

Submission status: Accepted

Solution code:
n = input()
mod = 0

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
# MOD = 998244353    

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
N = str(input())
array = list(map(int, N))
N_sum = sum(array)

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

Solution code:
N = input()
sum = 0

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
n = input()
cnt = 0
for i in range(len(n)):
    cnt += int(n[i])

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

Submission status: Accepted

Solution code:
n = input()

tot = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
n = input()

sum = 0

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

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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, x, t = map(int, input().split())
  # print(A(n, x, t))
  n_str = input()
  print(B(n_str))


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys,collections
from sys import stdin, stdout  
#MAXN = 10000001

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()
#spf = [0 for i in range(MAXN)] 
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) : 
  
    # Compute sum of digits 
    n = len(st) 
    digitSum = 0
      
    for i in range(0,n) : 
        digitSum = digitSum + (int)(st[i]) 
  
    # Check if sum of digits 
    # is divisible by 9. 
    return (digitSum % 9 == 0)     
#file()
#sieve() 
mod=(10**9)+7

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

	





















	




















		
			


		

			

		





			

	























				

	















	

	










if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())

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

Submission status: Accepted

Solution code:
N = input()

ans = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
int_n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()


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

Submission status: Accepted

Solution code:
n = sum([int(_) for _ in list(str(input()))])
if n % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# print(pow(10,200000))
N = int(input())
if(N%9 == 0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 17:00:46 2020

@author: saito
"""

# %% import phase

# %% define phase

# %% input phase
N = input()

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


# %%output phase
print(ans)

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


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


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


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = next(tokens)  # type: str
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

sum = 0

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

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

Submission status: Accepted

Solution code:
s=input()

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

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

Submission status: Accepted

Solution code:
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


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

Submission status: Accepted

Solution code:
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')