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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

tmp = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
modulo9 = 0
for c in N:
    modulo9 += int(c)
    modulo9 %= 9

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
num = int(input())
print("Yes") if num%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 = input()
n = int(N)

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

Submission status: Accepted

Solution code:
print"YNeos"[input()%9>0::2]

Submission status: Accepted

Solution code:
n = input() 

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

Submission status: Accepted

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

Submission status: Accepted

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

  
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
n = int(input())
ln = list(str(n))
from collections import Counter
nc = dict(Counter(ln))
s = 0
if n != 0:
    for i in range(1, 10):
        if str(i) in nc:
            s += i * nc[str(i)]
if s % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
# cook your dish here
mod = int(input())%9
if mod == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N=input()
tmp=0

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

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

Submission status: Accepted

Solution code:
n = input()
def check(st) : 
    n = len(st) 
    digitSum = 0 
    for i in range(0,n) : 
        digitSum = digitSum + (int)(st[i])  
    return (digitSum % 9 == 0)  
     
if(check(n)) : 
    print("Yes") 
else :  
    print("No")

Submission status: Accepted

Solution code:
def digital_root(n):
  return n if n < 10 else digital_root(sum(map(int,str(n))))
 
n = int(input())
if(digital_root(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())
NN=[int(N) for N in N]
if (sum(NN)%9==0):
    print ("Yes")
else:
    print ("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
digits = list(N)
sum = 0
for d in digits:
     sum += int(d)

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=input()
ans=0;
for i in s:
  ans+=int(i)
if(ans%9==0):
	print("Yes");
else:
  print("No");

Submission status: Accepted

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

sum = sum(num)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = input()
s=0

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

v = s%9

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

Submission status: Accepted

Solution code:
num = input()
flag1 = False
flag2 = False
if int(num) % 9 == 0:
    flag1 = True

sum = 0
for i in num:
    sum += int(i)
  
if sum % 9 == 0:
    flag2 = True
    
if flag1 and flag2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
sumN = sum(int(digit) for digit in str(N))
if sumN%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

N = list(input())

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

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

tmp = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = str(input())
L = list(N)
r = 0
for l in L:
    r = r + int(l)

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

Submission status: Accepted

Solution code:
# cook your dish here
n=int(input())
str_n=str(n)
list_n=list(str_n)
count=0
for i in range(0,len(list_n)):
    count+=int(list_n[i])
    
    
if(count%9 == 0 ):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
result=sum(list(map(int, str(N))))
if result%3==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# your code goes here
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()

def nine(n):
    array = list(map(int,list(n)))
    a = sum(array)
    if a % 9 == 0 :
        print('Yes')
    else :
        print('No')

nine(N)

Submission status: Accepted

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

n = list(input())
m = len(n)
t = 0
for i in range(m-1):
    t = (t+int(n[i]))%9

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 22 21:40:47 2020

@author: naoki
"""

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

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

Submission status: Accepted

Solution code:
A = list(input())
count = 0
for i in A:
    count += int(i)

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


# print('{:.10f}'.format(count/n))

Submission status: Accepted

Solution code:
N = list(input())
Ns = sum(int(i) for i in N)

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit,stdout
from collections import deque, defaultdict,Counter
from math import log2, log, ceil,sqrt
from operator import *
input = stdin.readline
setrecursionlimit(int(2e5))
def getstr(): return input()[:-1]
def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint1(): return list(map(lambda x : int(x) - 1, input().split()))
jn = lambda x,l: x.join(map(str,l))
# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp
 
## gcd function
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a, a)
 
## nCr function efficient using Binomial Cofficient
def nCr(n, k): 
    if(k > n - k): 
        k = n - k 
    res = 1
    for i in range(k): 
        res = res * (n - i) 
        res = res / (i + 1) 
    return res 
 
## upper bound function code -- such that e in a[:i] e < x;
def upper_bound(a, x, lo=0):
    hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x:
            lo = mid+1
        else:
            hi = mid
    return lo
 

# sliding window ---

def maxSlidingWindow(nums,k):
    windowSum,maxSum = 0,0
    windowSum = sum(nums[:k])
    for end in range(k,len(nums)):
        windowSum += nums[end]-nums[end - k]
        maxSum = max(maxSum,windowSum)
    return maxSum


# Two Pointer 
def twoSum(nums, target):
        left = 0
        right = len(nums)-1
        while left <= right:
            if nums[left]+nums[right] == target:
                return [left,right]
            elif nums[left]+nums[right] < target:
                left +=  1
            else:
                right -= 1
        return 

# prefix sum

def prefix(arr):
    a = map(add,arr.insert(0,0))
    return a

# Modular Inverse
# y-1 = y(p-2)%p

# String Matching





## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    primes = {}
    while(n%2 == 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes
 
## MODULAR EXPONENTIATION FUNCTION
def power(x, y, p): 
    res = 1
    x = x % p  
    if (x == 0) : 
        return 0
    while (y > 0) : 
        if ((y & 1) == 1) : 
            res = (res * x) % p 
        y = y >> 1      
        x = (x * x) % p 
    return res 
 
## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b
 
# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];
 
# find function with path compression (ITERATIVE)
def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];
    
    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;
 
 
# the union function which makes union(x,y)
# of two nodes x and y
def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x
 
## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
def sieve(n): 
    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
    return prime


# Binary Search functions
def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1


# Grafh related queries : 



graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000
 
 
def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)
 
 
def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d
 
 
def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d
 
 
def connected_components(graph):
    seen = set()
 
    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component
 
    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans

# End graph related queries
 
#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e6 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    ## function for storing smallest prime factors (spf) in the array
 
################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)] 
spf_sieve() 
def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)
 
## taking integer array input


# LCM of two numbers :
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
 
#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');
y, n = "Yes", "No"
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}


# used for testing your code 

# inputs=open('input.txt','r') 
# L I S
def solve():
    x = getint()
    if x == 0:
        print(y)
    else:
        c = 0
        for i in str(x):
            c += int(i)
        if c%9 == 0:
            print(y)
        else:
            print(n)

if __name__ == "__main__":
    # solve()
    # for t in range(getint()):
    #     print("Case #{}: ".format(t + 1), end="")
    #     solve()
    # for _ in range(int(inputs.readline())):#getint()):
    solve()

Submission status: Accepted

Solution code:
a=list(input())
sum=0
for i in a:
  sum+=int(i)
if sum%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()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
l=[]
sm=0
arr=["0","1","2","3","4","5","6","7","8","9"]
for i in range(0,10):
  l.append(s.count(arr[i]))
for i in range(0,10):
    a=int(l[i])
    sm=sm+(a*i)
if sm%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:
import sys

def total(f):
    t = 0
    while True:
        s = f.read(1)
        if s:
            c = ord(s[0]) - 48
            if 0 <= c <= 9:
                t += c
                continue
        break
    return t

t = total(sys.stdin)
print('Yes' if t % 9 == 0 else 'No')

Submission status: Accepted

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

while int(n)>9:
    nn=list(n)
    nbox=list(map(int,nn))
    n=str(sum(nbox))
if int(n)==9:
    print('Yes')
elif int(n)==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
S = 0
for s in N:
    S += int(s)
YesNo = lambda tf: print('Yes') if tf else print('No')
YesNo(S % 9 == 0)

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N = str(input())

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

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

Submission status: Accepted

Solution code:
N = input()

acc = 0
for i in N:
    i = ord(i) - ord('0')
    acc += i
    acc %= 9
if acc % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 全探索だと間に合わない？

def main():
    N = input()
    res = 0
    for i in N:
        res += int(i)

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N =int(input())
lst = []

N = str(N)

list_num = list(N)

N = [int(s) for s in list_num]
ans = sum(N)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:

N=input()

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

Solution code:
def isMultiple9(X):
    count = 0
    for i in X:
        count += int(i)
    
    return 'Yes' if count % 9 == 0 else 'No'

X = str(input())
print(isMultiple9(X))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(st) : 
  
   
    n = len(st) 
    digitSum = 0
      
    for i in range(0,n) : 
        digitSum = digitSum + (int)(st[i]) 
  
    return (digitSum % 9 == 0) 
  

st = input()
  
if(check(st)) : 
    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())

total = 0
n = str(n)
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()
count = 0

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

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

Submission status: Accepted

Solution code:
number=input()
sum=0
for i in number:
    sum=sum+int(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)

a = int(input())
b = digitSum(a)
if a % 9 == 0:
  if b % 9 == 0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

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

Multi=0
i=0
l=len(N)

for i in range(l):
	Multi=Multi+N_int[i]
	i=i+1

mod = Multi % 9

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

Submission status: Accepted

Solution code:
def nine():
    N=int(input())
    if N%9 != 0:
        return "No"
    else:
        t=(i for i in str(N))
        sum=0
        for i in t:
            sum+=int(i)
        if sum%9 == 0:
            return "Yes"

print(nine())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
### 数列をいったん文字列に変換
numberString = input()
sumNumber = 0

### 文字列を分割、整数化
for i in range(len(numberString)):
  sumNumber += int(numberString[i])
  
  
### 和を9を法とする式で計算。
if sumNumber % 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)
ans = 'No'
N = int(input())
digitSum = digitSum(N)
if digitSum % 9 == 0:
    ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
if sum([int(i) for i in list(input())]) % 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])

if cnt % 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()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
N = reduce(lambda x,y:int(x)+int(y), "0"+input())
if not N%9:
  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:
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()



def main():
	n=RD()
	x=0

	for i in n:
		x+=int(i)
		x%=9

	ans="No"
	if x==0:
		ans="Yes"

	print(ans)





if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
n=input()


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

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

Submission status: Accepted

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

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

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

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

print("No")

Submission status: Accepted

Solution code:
N = int(input())
result = 'No'

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

print(result)

Submission status: Accepted

Solution code:
N = int(input())
array = list(N.__str__())

t = []
for i in range(0, len(array)):
    if int(array[i]) % 9 != 0:
        t.append(int(array[i]))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input().strip()

cnt = 0
for c in S:
    cnt += int(c)

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

else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = list(input())
k = 0

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

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

else:
    print("No")

Submission status: Accepted

Solution code:
def main() :
	n = list(int(j) for j in input().strip())
	s = sum(n)
	if s % 9 == 0 : print("Yes")
	else : print("No")

if __name__ == '__main__' :
	main()

Submission status: Accepted

Solution code:
def digit_sum(n):
    n_lst = list( str(n) )
    n_sum = 0
    for i in range( len(n_lst) ):
        n_sum += int( n_lst[i] )
    return n_sum

n1 = input()
if digit_sum(n1)%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())
if digitSum(N)%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

N = read().rstrip()

x = sum(x - ord('0') for x in N)
print('Yes' if x % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
a = str(input())
num = int(a)


sub = int(10**(len(a))-1)
if (num-sub)%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = map(str, input())
l = [i for i in N]

num = 0

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

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

Submission status: Accepted

Solution code:
n = input()
ans = ["No" for _ in range(9)]
ans[0] = "Yes"
t = 0
for c in n:
    t += int(c)
    t %= 9
print(ans[t])

Submission status: Accepted

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