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: Time Limit Exceeded

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
N = int(input())
a = 0
while N != 0:
    a += N % 10
    N = N //10
if a%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    def digit_sum(n):
        res = 0
        while n > 0:
            res += n % 10
            n //= 10
        return res

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


if __name__ == '__main__':
    resolve()

Submission status: Time Limit Exceeded

Solution code:
import sys,bisect

from sys  import stdin,stdout

from bisect import bisect_left,bisect_right,bisect,insort,insort_left,insort_right

from math import gcd,ceil,floor,sqrt

from collections import Counter,defaultdict,deque,OrderedDict

from queue import Queue,PriorityQueue

from string import ascii_lowercase

sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 998244353
mod = 10**9+7

def isPrime(n):
    
    if (n <= 1) :return False
    if (n <= 3) :return True
    if (n%2 == 0 or n%3 == 0):return False
    for i in range(5,ceil(sqrt(n))+1,6):
        if (n%i==0 or n%(i+2)==0):
            return False
    return True


def st():
    return list(stdin.readline().strip())

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

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

def mp():
    return map(int,stdin.readline().split())

def pr(n):
    stdout.write(str(n)+"\n")
    
def DFS(dictionary,vertex,visited):
    visited[vertex]=True
    stack=[vertex]
    print(vertex)
    while stack:
        a=stack.pop()
        for i in dictionary[a]:
            if not visited[i]:
                print(i)
                visited[i]=True
                stack.append(i)


def BFS(dictionary, vertex,visited):
    visited[vertex]=True
    q=deque()
    q.append(vertex)
    while q:
        a=q.popleft()
        for i in dictionary[a]:
            if not visited[i]:
                visited[i]=True
                q.append(i)
                print(i)

                


def soe(limit):
    l=[1]*(limit+1)
    l[0]=0
    l[1]=0
    prime=[]
    for i in range(2,limit+1):
        if l[i]:
            for j in range(i*i,limit+1,i):
                l[j]=0
    
    for i in range(2,limit+1):
        if l[i]:
            prime.append(i)
    return prime

def segsoe(low,high):
    limit=int(high**0.5)+1
    prime=soe(limit)
    n=high-low+1
    l=[0]*(n+1)
    for i in range(len(prime)):
        lowlimit=(low//prime[i])*prime[i]
        if lowlimit<low:
            lowlimit+=prime[i]
        if lowlimit==prime[i]:
            lowlimit+=prime[i]
        for j in range(lowlimit,high+1,prime[i]):
            l[j-low]=1
    for i in range(low,high+1):
        if not l[i-low]:
            if i!=1:
                print(i)
                
def gcd(a,b):
    while b:
        a=a%b
        b,a=a,b
    return a

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r
    
def solve():
    n=inp()
    s=0
    while n:
        s+=n%10
        n=n//10
    if s%9==0:
        pr('Yes')
    else:
        pr('No')
    
    




for _ in range(1):
    solve()

Submission status: Accepted

Solution code:
def A():
    n, x, t = map(int, input().split())
    print(t * ((n+x-1)//x))

def B():
    n = list(input())
    s = 0
    for e in n:
        s += int(e)
    print("Yes" if s % 9 == 0 else "No")

def C():
    int(input())
    a = list(map(int, input().split()))
    l = 0
    ans = 0
    for e in a:
        if e < l: ans += l - e
        l = max(l, e)
    print(ans)

B()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = input()
sum = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
print("Yes" if sum(map(int,s))%9==0 else "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()
s=0
for i in n:
  s += int(i)
if s%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:
import sys
read = sys.stdin.read
#readlines = sys.stdin.readlines
from math import ceil
def main():
    n = tuple(map(int, tuple(input())))
    if sum(n) % 9 == 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = list(input())
n = len(N)
X = 0
k = 0
for i in range(0, n):
  X += int(N[i])

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

Submission status: Accepted

Solution code:
import math

n = input()

n_list = map(int, list(n))
ans = sum(n_list)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input()

sumRes = sum(list(map(int, N)))

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

Submission status: Accepted

Solution code:
big = str(input())
num = 0
for x in range(len(big)):
    num += int(big[x])
if num % 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 = int(input())

v = 0

for c in str(N):
    v += int(c)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

S = 0
for m in N:
    S += int(m)
    S %= 9

if S == 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:
def main():
    n = list(map(int, input()))
    if sum(n)%9 == 0:
        print('Yes')
    else:
        print('No')
        
        
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())

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

Submission status: Accepted

Solution code:
n = input()
cnt = 0

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

if cnt % 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:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools as fts
import itertools as its
import math
import sys

INF = float('inf')
YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: str):
    return [NO, YES][sum(int(c) for c in N) % 9 == 0]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = next(tokens)  # type: str
    print(f'{solve(N)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())


def solve1(n: int) -> str:
    k = 0
    for i in range(len(n)):
        k += int(n[i])

    if k % 9 == 0:
        return "Yes"
    else:
        return "No"


def solve2(n: int) -> str:
    if n % 9 == 0:
        return "Yes"
    else:
        return "No"


print(solve2(n))

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

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

Submission status: Accepted

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

for s in n:
    cnt += int(s)

if cnt % 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 = 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:
print('No' if sum(map(int, input())) % 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:
import sys

a = sum([int(num) for num in list(input())]) % 9

if a == 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:
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:

n = int(input())

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

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(j) for j in input().split()]
#template
suma =0
N = input()
for i in range(len(N)):
    suma+= int(N[i])
if suma % 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:
num = list(str(input()))
num = [int(x) for x in list(num)]
print('Yes' if sum(num) % 9 == 0 else 'No')

Submission status: Accepted

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

a = input().strip()
res = sum(int(i) for i in a) % 9 == 0
print('Yes' if res else 'No')

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
n = list(input())
for i in range(len(n)) :
    n[i] = int(n[i])
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 = int(input())

n = str(N)

le = len(n)

M = 0

for i in range(le):
    nn = int(n[i])
    M += nn

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

Submission status: Accepted

Solution code:
n = list(input())

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

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

Submission status: Accepted

Solution code:
n = int(input())
div = 0
for i in str(n):
    num = int(i)
    div += num

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

Submission status: Accepted

Solution code:
n=input()
div=0
for ch in n:
    num=int(ch)
    div+=num

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input()))
sum = 0
for i in range(len(l)):
    sum += l[i]

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

Submission status: Accepted

Solution code:
total = 0
for ch in input().strip():
	total = (total + int(ch)) % 9
print('No' if total else 'Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

n1 = [int(i) for i in n]

sum = 0
for i in n1:
    sum += 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 sum%9 == 0 : print("Yes")
else : print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N = input()
    s = 0
    for i in range(len(N)):
        s += int(N[i])
    if s%9 == 0:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=list(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:
n = int(input())
print('Yes' if n % 9 == 0 else '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(map(int, input().split()))
print('Yes' if sum(n) % 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:
# -*- coding: utf-8
s = list(map(str,input().split()))
sum = 0
for i in range(len(s)):
    sum += (int) (s[i])
if sum %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])
if(ans%9==0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(N):
    ans = 0
    for n in str(N):
        ans += int(n)
    if ans%9==0:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    N = int(input())
    ans = main(N)
    print(ans)

Submission status: Accepted

Solution code:
a=input()
ans=0
for i in a:
  ans = (ans+int(i))%9
print(["Yes","No"][ans>0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#176-B

N = input()
sum = 0
for i in range(1,len(N)+1):
  sum += int(N[-i])

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

Submission status: Accepted

Solution code:

n = int(input())

ans = 0

l = [int(x) for x in list(str(n))]
ans = sum(l)

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

Submission status: Accepted

Solution code:
#176-B

N = int(input())
mod = N % 9

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
N_str = str(N)
a = 0
for i in range(len(N_str)):
  a += int(N_str[i])
if a % 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:
n = input()
print('Yes' if sum(list(map(int, list(n)))) % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

n = str(N)

c = len(n)
total = 0

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

Submission status: Accepted

Solution code:
N = list(input())
temp = 0
for n in N:
    k = int(n)
    temp += k
if temp % 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:
#B問題

#ABSの定石使うとなぜかRE

#今回はPython解説サイト参照

#①入力を文字列で受け取る→②一文字ずつ整数に変換して、forループで回しながら足し算する

N = input()
cur = 0

for i in N:
    cur += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
ans = 0
for i in n:
    ans += int(i)

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

Submission status: Accepted

Solution code:
N = input()
cnt = 0
for i in range(10):
  cnt += i * N.count(str(i))
print("Yes" if cnt % 9 == 0 else "No")

Submission status: Accepted

Solution code:
# import itertools
# import math
# import fractions
# import functools
# import copy
# from collections import deque
# from functools import reduce
# from decimal import Decimal


def main():
    n = input()
    sum = 0
    for i in range(len(n)):
        sum += int(n[i])

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=input()
x=0
for i in n:
    x+=int(i)
print("Yes" if x%9==0 else "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()
res = 0
for i in range(len(n)):
    res += int(n[i])
print("Yes" if res%9 == 0 else "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())
K = str(N)
L = len(K)
K.split(',', L)
num_list = list(map(int, K))
A = 0

for i in range(L):
    A += num_list[i]

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

n = input()
n = n.replace('\n','')

n_list = list(n)


su = 0
for n in n_list:
    n_int = int(n)
    su += n_int

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m = input("")
s = m.split(".")
sum = 0
if len(s) == 1 and int(m)>=0 and int(m)<10**200000:
    for i in m :
        sum = sum+int(i)
    if sum % 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:
x = input("")
for i in range(3):
    alist = list(map(int,x))
    result = sum(alist)
    x = str(result)
if result % 9 == 0 :
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# cording:utf-8

# 整数を入力
N = int(input())

# Nが9の倍数ならyesを出力
if N % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
sm = 0
for c in s:
    sm += int(c)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#####
# B #
#####

N = input()
sum = sum(map(int,N))

if sum % 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])

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

Submission status: Accepted

Solution code:
def digitsum(n):
    res = 0
    for i in n:
        #print(ni)
        ni = int(i)
        res += ni
    return res 

s = input()
r = digitsum(s)

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

Submission status: Accepted

Solution code:
n = list(input())
b = int(n[0])
for a in range(len(n)-1):
    b = b + int(n[a+1])
if b % 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(input())

if n % 9 == 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:
a=input()
values=[int(i) for i in a]
if sum(values)%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:
user_input=input()
i=len(user_input)-1
number=0
while i>=0:
        number+=int(user_input[i])
        i=i-1
if number%9==0:
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
str = input()
sum = 0
for ch in str:
    sum += ord(ch) - ord('0')
if sum % 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
for i in input():
  a += int(i)
print("Yes" if a%9==0 else "No")

Submission status: Accepted

Solution code:
q=(input())
A=(list(q))
S=map((lambda x: int(x)),A)
W=sum(S)
if W%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:
a = int(input())
if a % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
D = input()
dlist = [int(x) for x in D]
ans = 0

for i in range (0, len(dlist)):
    ans += dlist[i]

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

Submission status: Accepted

Solution code:
N = input()

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

if(sum_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:
def solve(n):
    res = 0
    for x in n:
        res += int(x)
    return "Yes" if res % 9 == 0 else "No"

n = input()
print(solve(n))

Submission status: Accepted

Solution code:
N=int(input())
n= str(N)
total=0
for i in range(len(n)):
  k = n[i]
  k = int(k)
  total += k
  
if total%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:
import numpy as np
data = np.array([int(x) for x in str(input())])

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

Submission status: Accepted

Solution code:
N = input()

answer = 0
for keta in N:
    answer = (answer + int(keta))%9
if not answer:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

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

Submission status: Accepted

Solution code:
n=str(input())
a=list(n)
b=0
for i in a:
    b=b+int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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