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:
from functools import reduce
def main():
    Ns = map(int, input())
    
    result = reduce(lambda a, b : (a + b) % 9, Ns)

    if result == 0:
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))
a=1
for i in l:
    a*=i
if(a%9 == 0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = list(input())

l_N = [int(s) for s in N]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = 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 = list(input())
N = [int(x) for x in N]

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# atcoder 
# Türkler var mı?
# Herkese memnün oldum
import sys

readline = sys.stdin.buffer.readline
iimr = lambda: map(int, sys.stdin.buffer.readline().rstrip().split())
#sys.setrecursionlimit(10 ** 8)

def debug(*x):
    print(*x, file=sys.stderr)


class atcoder():
    def __init__(self):
        pass

    def çözmek(self):
        N = input()

        res = []    
        res.append(self.関数(N))
        if res[0] % 9:
            print("No")
        else: 
            print("Yes")
    
    def 関数(self, n):
        gr = len(n)
        wa = 0
        for i in range(gr):
            wa += int(n[i])
        #debug(wa)
        return wa

if __name__ == "__main__":
    ima = atcoder()
    ima.çözmek()

Submission status: Accepted

Solution code:
def main():
  a = 0
  b = 0
  a = int(input())
  b = a%9
  if b==0:
    print("Yes")
  else :
    print("No")
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()

num = 0

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


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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    N = input().strip()
    res = 0
    for n in N:
        res += int(n)
        res %= 9
    print("Yes" if res == 0 else "No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())

sum = digitSum(N)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def main():
    input_num = input()
    sum_num = 0

    for i in range(len(input_num)):
        chushutsu = int(input_num[i])
        sum_num += chushutsu
    
    if sum_num % 9 == 0:
        print('Yes')

    else:
        print('No')

if __name__ == '__main__':
    main()

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 sys
import numba
from numba import jit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(n):
  wa = 0
  for i in n:
    wa += int(i)
  if wa%9 == 0:
    return 'Yes'
  else:
    return 'No'

n= readline().split()
print(main(n))

Submission status: Accepted

Solution code:
N = list(input())

Nsize = len(N)
for k in range(Nsize):
    N[k] = int(N[k])
Nsum = sum(N)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input()

sum_of_digits = 0
for digit in str(N):
    sum_of_digits += int(digit)
if sum_of_digits % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def sum_digits_string(str1):
    sum_digit = 0
    for x in str1:
        if x.isdigit() == True:
            z = int(x)
            sum_digit = sum_digit + z

    return sum_digit
     
n=input()
if sum_digits_string(n)%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s = sum(n)

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

Submission status: Accepted

Solution code:
n = input()
s = str(n)
l = len(s)
ans = 0
for i in range(l+1):
    ans += int(s[-i]) 
p = ans-(int(s[-l]))
if p%9 == 0:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = 0

for i in input().split():
    ans += int(i)

print("No" if ans%9 else "Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


Nlist = list(str(N))

keep = list(map(int,Nlist))


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

Submission status: Accepted

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

Nsum = sum(Nlis)

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

Submission status: Accepted

Solution code:
def nineJoke(val):
  if (val % 9 == 0):
    return 'Yes'
  else:
    return 'No'
  
def userInput():
  a = int(input())
  return nineJoke(a)
  
print(userInput())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(map(int, input().split()))
n_sum = 0

for n in N:
    n_sum += n

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
num = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

if __name__ == "__main__":
    n = input()
    sum_n = 0
    for n_i in n:
        sum_n += int(n_i)
    if sum_n%9==0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
tmp = 0
for i in range(10): 
    c=n.count(str(i))
    tmp += c*i

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

Submission status: Accepted

Solution code:
n=input()
s = str(n)
array = list(map(int, s))
a=sum(array)
num=int(n)
b=num%9
if a%9==0 and b==0:
     print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = input()
    if int(N) < 0 or int(N) >= 10**200000:
        raise ValueError
    i = 0
    sum = 0
    for i in N:
        sum += int(i)
        if sum % 9 == 0:
            sum = 0
    if sum % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())

Ns = 0

for x in N:
    Ns = Ns + int(x)

loops = 0
while Ns > 10:
    Ns_str = str(Ns)
    Ns = 0
    for x in Ns_str:
        Ns = Ns + int(x)
    loops = loops + 1
    if loops > 1000000:
        break

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

Submission status: Accepted

Solution code:
N = int(input())
S = [int(i) for i in str(N)]
L = len(S)
sum = 0
i = 0

while i < L:
    sum = sum + int(S[i])
    i = i + 1
    
if (sum % 9) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
def main(lines):
  n = len(lines)
  x = 0
  for i in range(n):
    x+=int(lines[i])
    
  if x//9 == math.ceil(x/9):
    print('Yes')
  else:
    print('No')

if __name__ == '__main__':
    lines = input()
    main(lines)

Submission status: Accepted

Solution code:
N = input()
rank = len(N) - 1
i = 0
while(len(N) != 0):
    a = N[0]
    N = N[1:]
    a = int(a)
    i += a
if (i % 9 == 0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n = list(input())
    n = [int(i) for i in n]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#1181201182 Takamasa Yoshinaga
N=input()
S=0
for i in range(0,len(N)):
    S+=int(N[i]);
    S=S%9;
if S==0:
    print("Yes");
else:
    print("No");

Submission status: Accepted

Solution code:
word = list(input())
A = len(word)
T = 0
for i in range(A):
    T += int(word[i])

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

Submission status: Accepted

Solution code:
N = list(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().strip()
summ = sum([int(i) for i in N])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
l = len(n)
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=input()
l = [int(x) for x in list(N)]
s=sum(l)
if s%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Nstr = input()

n = list(Nstr)

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

if 0 == sum % 9:
    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 sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

s = readline().rstrip().decode('utf-8')

ans = 0

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

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

Submission status: Accepted

Solution code:
N_str = input()
N_int = int(N_str)

summ = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

count = sum(list(map(int, str(N))))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input("").split()
sum = 0
ans = "No"
for num in a:
    sum += int(num)
if sum % 9 == 0:
    ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
n = str(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 = int(input())

k = N % 9

if k == 0:
    print('Yes')
    
if k != 0:
    print('No')

Submission status: Accepted

Solution code:
n = str(input())
a = 0 

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

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

Submission status: Accepted

Solution code:
N = input()
nli = []
for i in range(len(N)):
    nli.append(N[i])
print("No" if sum(map(int, nli)) % 9 else "Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

n = len(N)
S = 0

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

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

else:
    print("No")

Submission status: Accepted

Solution code:
n = sum(list(map(int,input())))

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

Submission status: Accepted

Solution code:
n = input()

res = 0
s = list(n)
for i in s:
    res += int(i)

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

Submission status: Accepted

Solution code:
n = int(input())
l = len(str(n))
wa = 0
if l >= 2**15:
    n = str(n)
    for i in range(l):
        wa += int(n[-i])
else:
    wa = n
if wa % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()

asdf = 0
for idx in range(len(N)):
    asdf += int(N[idx])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
U = []
for i in range(len(N)):
    U.append(N[i])
print("No" if sum(map(int, U)) % 9 else "Yes")

Submission status: Accepted

Solution code:
N = input()
l = len(N)

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

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

Submission status: Accepted

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

listN = list(n)

result = 0

for value in range(len(listN)):
    result += int(listN[value])

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

Submission status: Accepted

Solution code:
from sys import stdin,stdout
s=sum([int(v) for v in input()])
print('No' if s%9!=0 else 'Yes')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
n = str(input())
    
running_sum = 0
for i in n:
    if i != "0" and i != "9":
        running_sum += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(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 = input()
res = sum((ord(x) - ord("0")) for x in n)
print("Yes" if res % 9 == 0 else "No")

Submission status: Accepted

Solution code:
# Q2
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
from functools import lru_cache

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

N = S()
total = 0
for c in N:
    total += int(c)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input().strip())

ans = 0
N = str(N)

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

Submission status: Accepted

Solution code:
N=input()
def digitSum(a):
    s=str(a)
    array=list(map(int,s))
    return sum(array)

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

Submission status: Accepted

Solution code:
N=str(input())
L=len(N)
X=0
ans=None

for i in range(0,L):
    Y=int(N[i])
    X=X+Y

if X%9==0:
    ans="Yes"
else:
    ans="No"

print(ans)

Submission status: Accepted

Solution code:
A=input()
B=int(9)
i,j=divmod(int(A),int(B))
if j == 0:
  j="Yes"
else:
  j="No"
print(j)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line.strip())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = lines[0]

    return (n, )


def solve(n, ):

    
    total = sum([int(e) for e in n])

    result = 'No' 
    #if sum(a) % 9 == 0:
    if total % 9 == 0:
        result = 'Yes'


    return result 


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

Solution code:
ans = input()
a = str(ans)
c = 0
for f in a:
  b = int(f)
  c = c + b
inp = c % 9
if inp == 0:
  print('Yes')
if inp != 0:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())

# sum = 0

# while(n >= 1):
#   sum += n % 10
#   n //= 10

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

Submission status: Accepted

Solution code:
tmp = input().rstrip()
x = 0
for f in tmp:
    x = x*10+int(f)
    x %= 9
print("Yes" if x == 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
result = n % 9

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

Submission status: Accepted

Solution code:
import math

a = input()
l = len(a)
ans = 0
for i in range(l):
    ans = ans + int(a[i])

if math.ceil(ans / 9 ) == ans /9:
    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 = input()
M = 0
l = [int(x) for x in list(str(N))]
for i in range(len(l)):
    M += l[i]
if M % 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 = [int(i) for i in str(int(input()))]

if sum(n) % 9 == 0:
  print("Yes")
else:
  print("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:
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())

n=input()
x=0
for i in n:
    x+=int(i)
    x%=9
if x==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 = int(input())
n = str(N)
list = [i for i in n]
plus = 0

for j in list:
    plus += int(j)

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

Submission status: Accepted

Solution code:
N = input()
m = 0
for x in N:
    m = (m + int(x)) % 9
if m == 0:
    print("Yes") 
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
s = input()
bara = list(s)
n = [int(s) for s in bara]

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

Submission status: Accepted

Solution code:
N=input()
N=list(N)
N=list(map(int,N))
c=len(N)
b=0

for i in range(0,c) :
    b+=N[i]
    
if b%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 = input()
S = 0
for c in N:
    S += int(c)
if S%9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())
# print(N)
N_list = list(map(float, N))
sumN = sum(N_list)
judge = sumN/9 - int(sumN/9)
if judge == 0:
    print("Yes")
else:
    print("No")

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()
M=list(N)
O=sum(int(i) for i in M)
if O%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

lst = input()
lst1= []
for i in lst:
    if i != '.':
        lst1.append(int(i))
q = 0
for i in lst1:
    q+=i
if q%9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
number = input()
sum_of_digits = 0
for digit in str(number):
    sum_of_digits += int(digit)
if sum_of_digits % 9 ==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = str(input())
N = list(N)
N = [int(i) for i in N]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

N_sum = sum(list(map(int, str(N))))

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

Submission status: Accepted

Solution code:
a=list(input())
sum=0

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

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

Submission status: Accepted

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


if(digitSum(input())%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 = int(input())
s = str(n)
array = list(map(int, s))
if sum(array) % 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:
a=0
n=input()
n=list(n)
n=list(map(int,n))
a=sum(n)
if a%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    ans = 0
    for rep in n:
        ans += int(rep)
        ans %= 9
    if ans==0:
        print('Yes')
    else:
        print('No')
    return

if __name__=='__main__':
    n = S()
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
num=int(n)
nl=list(n)
sum=0

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

# N = str(10 ** 200000 - 1)

s = 0

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

Submission status: Accepted

Solution code:
# from pprint import pprint
# import math
# import collections

n = input()
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))

l = map(int, list(n))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding=utf-8

if __name__ == '__main__':
    N = input()

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

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

Submission status: Accepted

Solution code:
z=[]
a=input()
for i in a:
    z.append(int(i))
a=sum(z)
b=str(a/9)
a2=b[b.index("."):]
if a2=='.0':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = int(input())

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

Submission status: Accepted

Solution code:
#list型で受け取るとき
N = input().split()

lenN = len(N)
x = 0

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = input().rstrip()

N_sum = 0

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

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline

N = readline().strip()

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

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