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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_n = input()
n = len(str_n)

cnt = 0
for i in range(n):
    cnt += int(str_n[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from functools import lru_cache
import math

#setrecursionlimit(10**6)
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')
MOD = 10**9 + 7

def main():
	n = str(int(rl()))
	tot = 0
	for c in n:
		tot += int(c)
	if tot % 9 == 0:
		print("Yes")
	else:
		print("No")

if __name__ == "__main__":
	main()

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())
list1 = []
sum: int = 0
for i in str(n):
    list1.append(int(i))
    sum +=int(i)
print("Yes" if n % 9 == 0 and sum % 9 == 0 else "No")

Submission status: Accepted

Solution code:
N = int(input())

num = str(N)
sum=0
for i in num:
    sum += int(i)

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

Submission status: Accepted

Solution code:
num = input()

intNum = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# string
# a, b, c = input().split()
# str_list = list(input().split())

# number
# a, b, c = map(int, input().split())
# num_list = list(map(int, input().split()))

# lows
# str_list = [input() for _ in range(n)]

# many inputs
# num_list = []
# for i in range(n): num_list.append(list(map(int, input().split())))

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

Submission status: Accepted

Solution code:
n=int(input())
a=sum(list(map(int,str(n))))
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 = int(input())
tmp = n % 9
if tmp == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = list(input())

sum_ = 0
for val in li:
  sum_ += int(val)
if sum_%9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def main():
    N = str(input())
    M = list(map(int, N))
    S = sum(M)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    sum = 0
    for digit in str(N):
        sum += int(digit)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
num = int(input())
ans = num%9

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

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

else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = str(n)
rrr = 0
for i in range(0,len(s)):
    rrr += int(s[i])
if rrr%9 == 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])
  cnt %= 9

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

Submission status: Accepted

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

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

a = sum([int(n) for n in list(N)])

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

Submission status: Accepted

Solution code:
N = str(input())

a = list(N)

result = 0

for x in a:
    x = int(x)
    result += x

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

x = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
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)
print('Yes') if sum % 9 == 0 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 = list(input())
result = 0
for num in N:
  result += int(num)
if result%9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())

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

Submission status: Accepted

Solution code:
print('YNeos'[sum(map(int,input()))%9!=0::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n):
    sum = 0
    for i in n:
        sum += int(i)
    if sum % 9 == 0:
        return "Yes"
    else:
        return "No"

if __name__ == "__main__":
    n = input()
    print(solve(n))

Submission status: Accepted

Solution code:
N = input().rstrip()
v = 0
for c in N:
	if c == '9':
		continue

	v += int(c)

num = int(v / 9)
r = 'Yes' if v == num * 9 else 'No'
print(r)

Submission status: Accepted

Solution code:
n=list(map(int,list(input())))
ans=0
for i in n:
    ans=(ans+i)%9
if ans==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])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
n = str(n)
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()
l = len(N)
sum = 0
for i in range(l):
    sum += int(N[i])
    sum %=9

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

Submission status: Accepted

Solution code:
N = input()
dig_sum = 0
for n in N:
    dig_sum += int(n)

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

Submission status: Accepted

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

if sum(m) % 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(i) for i in list(input())]
n = 0
for i in N:
    n = (n+i)%9
if n == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = list(input())
c = 0

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

if c % 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 math
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:
x=list(input())
a=0
for i in x:
  a+=int(i)
if a%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:

number = input()

result = 0
for char in number: 
    result += int(char)

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    sm = 0
    for c in s:
        sm += int(c)
    if sm % 9 == 0:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

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())
print('No' if n % 3 else 'Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())
lenn = len(n)

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

sum = 0
if int(N) != 0:
    data_size = len(N)
    for data_size in range(data_size):
        sum += int(N[data_size])

else:
    sum = 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:
n=sum([int(_) for _ in 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%3==0 else 'No')

Submission status: Accepted

Solution code:
#ver3 
N=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=int(input())
print('Yes' if N%9==0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ver2
N=map(int,list(input()))
Total=sum(N)
#print(Total//9 , Total/9)
if (Total//9 == Total/9):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=map(int,list(input()))
Total=0
for n in N:
  Total+=n
#print(Total//9 , Total/9)
if (Total//9 == Total/9):
  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:
a=int(input())
if a%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
d = N % 9
s = sum(list(map(lambda x: int(x), list(str(N))))) % 9

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

Submission status: Accepted

Solution code:
N = int(input())
div = N % 9
s = sum(list(map(lambda x: int(x), list(str(N))))) % 9

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

Submission status: Accepted

Solution code:
N = list(input())

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

Submission status: Accepted

Solution code:
line = input()
N = int(line)

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

Submission status: Accepted

Solution code:
from __future__ import division, print_function
# import threading
# threading.stack_size(2**27)
# import sys
# sys.setrecursionlimit(10**7)
# sys.stdin = open('inpy.txt', 'r')
# sys.stdout = open('outpy.txt', 'w')
from sys import stdin, stdout
import bisect            #c++ upperbound
import math
import heapq
i_m=9223372036854775807
def inin():
    return int(input())
def stin():
    return input()
def spin():
    return map(int,stin().split())
def lin():                           #takes array as input
    return list(map(int,stin().split()))
def matrix(n):
    #matrix input
    return [list(map(int,input().split()))for i in range(n)]

################################################
def calculate_sum(a, N): #sum of a to N
    # Number of multiples 
    m = N / a 
    # sum of first m natural numbers 
    sum = m * (m + 1) / 2
    # sum of multiples 
    ans = a * sum
    return ans
def series(N):
    return (N*(N+1))//2

def count2Dmatrix(i,list):
    return sum(c.count(i) for c in list)

def modinv(n,p):
    return pow(n,p-2,p)

def GCD(x, y): 
    x=abs(x)
    y=abs(y)
    if(min(x,y)==0):
        return max(x,y)
    while(y): 
        x, y = y, x % y 
    return x
def LCM (x, y):
    return (x * y) // GCD(x, y)
    
def Divisors(n) : 
    l = []  
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) : 
            if (n // i == i) : 
                l.append(i) 
            else : 
                l.append(i)
                l.append(n//i)
    return l
def isprime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True
prime=[]
def SieveOfEratosthenes(n): 
    global prime
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p): 
                prime[i] = False
        p += 1
    f=[]
    for p in range(2, n): 
        if prime[p]: 
            f.append(p)
    return f
q=[]       
def dfs(n,d,v,c):
    global q
    v[n]=1
    x=d[n]
    q.append(n)
    j=c
    for i in x:
        if i not in v:
            f=dfs(i,d,v,c+1)
            j=max(j,f)
            # print(f)
    return j
# d = {}
 
"""*******************************************************"""
n = (list(input()))
n = map(int, n)
# print(list(n))
print("Yes") if sum(n)%9==0 else print("No")

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

Solution code:
n = int(input())

def checkMult9(m):
	ms = str(m)
	if len(ms) > 2:
		s = 0
		for letter in ms:
			s += int(letter)
		return checkMult9(s)
	return m%9 == 0

print('Yes' if checkMult9(n) else 'No')

Submission status: Accepted

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())
num = 0
for i in n:
    num += int(i)
if num%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:
# coding: UTF-8
import sys
import numpy as np
import time

# f = open("input.txt", "r")
# sys.stdin = f

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
myList = input()
sum = 0
for i in myList:
    sum+=int(i)
print(("Yes","No")[sum%9!=0])

Submission status: Accepted

Solution code:
def multiple9(N):
    sN = str(N)
    sum = 0
    for i in range(len(sN)):
        sum += int(sN[i])
    if sum % 9 == 0:
        return 'Yes'
    else:
        return 'No'

if __name__ == "__main__":
    N = int(input())
    print(multiple9(N))

Submission status: Accepted

Solution code:
a = input()
b = len(a)
c = 0

for i in range(b):
  c += int(a[i])
  
d = c % 9

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

Submission status: Accepted

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

if total % 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:
# 問題：https://atcoder.jp/contests/abc176/tasks/abc176_b

n = input()
res = 0
for x_str in n:
    res += int(x_str)
if res % 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 = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
import math
def Ii():return int(sys.stdin.readline().rstrip())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))

s = sys.stdin.readline().rstrip()
ans = 0
for i in s:
	ans += int(i)
	ans %= 9

print('Yes' if ans%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:
s = input()

tmp = 0

for c in s:
	tmp+=int(c)
	tmp-=int('0')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=list(map(int,input().split()))
SUM=0
for i in N:
    SUM+=i
if SUM%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
res = 0
for x in s:
    res += int(x)
if res %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 = input()
x = 0

while len(N)>1:
    x = 0
    for i in range(len(N)):
        x += int(N[i])
    N = str(x)
if int(N)%9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#pylint: disable=missing-docstring,bad-whitespace,invalid-name,len-as-condition,trailing-newlines,multiple-statements,unnecessary-semicolon,trailing-whitespace,superfluous-parens
import math as M

num = input()
sum = 0
for ch in num :
    sum += ord(ch)-ord('0')
if sum%9==0 :
    print('Yes')
else :
    print('No')
exit()      

n,x,t = (map(int,input().split()))
print(t*(n//x) + t*(min(n%x,1)))
exit()

n = int(input())
a = list(map(int,input().split()))
cm = 1000
p1 = p2 = a[0]
for i in range(1,n):
    #print(i,a[i],p1,p2)
    if(a[i]>=p2):
        p2 = a[i]
    elif(a[i]<p2):
        cm += (cm//p1)*(p2-p1)
        p1 = p2 = a[i]
cm += (cm//p1)*(p2-p1)
print(cm)
exit()

cm = 1000
for i in range(0,40):
    st = cm//100
    cm -= st*100
    cm += st*200
print(cm)
print(M.log10(cm))
print(M.log2(10**16))
exit()

isPrime = [1]*101
isPrime[0]=isPrime[1]=0
for i in range(2,int(M.sqrt(101)+1)) :
    if not isPrime[i] : continue
    for j in range(i*i,101,i) :
        isPrime[j]=0

pa = 5
pb = 1
ctr= 0
for i in range(2,101) : 
    if not isPrime[i] : continue
    if i==5 : 
        ctr+=1
        continue
    if(ctr&1) : 
        pa *= i
    else : 
        pb *= i
    ctr+=1
print(pa,' ',pa<=2*(10**18))
print(pb,' ',pb<=2*(10**18))


#init pa = 5, pb = 1
#into b  2
#into a  3
#into a  7
#into b  11
#into a  13
#into b  17
#into a  19
#into b  23
#into a  29
#into b  31
#into a  37
#into b  41
#into a  43
#into b  47
#into a  53
#into b  59
#into a  61
#into b  67
#into a  71
#into b  73
#into a  79
#into b  83
#into a  89
#into b  97
#1931237034633205845   True
#1193829614179601806   True

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

n = input()
n = list(n)

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

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

Submission status: Accepted

Solution code:
import math
n = input()
t = 0
for i in range(len(n)):
  t += int(n[i])
if t % 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 math
def gcd(a,b):
	if a == 0:
		return b
	return gcd(b%a,a)

def solve(n):
	return n%9

def main():
	n = int(input())
	res = solve(n)
	if res == 0:
		print("Yes")
	else:
		print("No")
if __name__ == "__main__":
	main()

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

Submission status: Accepted

Solution code:
N=input()
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:
N = list(map(int, input()))

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
if N % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

l=list(map(int,str(n)))

a=sum(l)

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

Submission status: Accepted

Solution code:
N = input()
total = 0
for i in N:
    total += int(i)

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

Submission status: Accepted

Solution code:
n = int(input())

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