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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-08-22 20:51:54 +0900
# LastModified: 2020-08-22 21:06:18 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


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

if __name__ == "__main__":
    main()

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:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    k = 0
    for i in str(n):
        k += int(i)
    print('Yes') if k % 9 == 0 else print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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


n=int(input())

s=str(n)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = str(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
total = 0
for s in n:
    total += int(s)

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

Submission status: Accepted

Solution code:
def main():
	n = int(input())
	
	n_list = list(str(n))

	ans = 0

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

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
N = input()
x = 0

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
count = 0

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

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

Submission status: Accepted

Solution code:
n = input()

n_sum = 0
for ns in n:
    n_sum += int(ns)

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**6)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = input()

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

q, mod = divmod(flag, 9)
if mod == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N = str(input())
ans = "yes"
count = 0
for i in range(len(N)):
    count += int(N[i])

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = input()
if sum(list(map(int, list(n)))) % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(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()
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:
from sys import stdin

def main():

    input = stdin.readline

    N = int(input())

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = input()
res = 0
for i in list(N):
    res += int(i)
if res%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = 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:
k = input()
ans = 0
for p in k:
    ans += int(p)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

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

Submission status: Accepted

Solution code:
n_str = input()
total = 0

for n in n_str:
  total += int(n)

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

Submission status: Accepted

Solution code:
line=input()
# print(line)

c=0
for i in line:
    c+=int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
l = len(s)
ans = 0

for i in range(l):
    ans += int(s[i])

if ans%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:
# coding: utf-8

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

main()

Submission status: Accepted

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

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


mod=1000000007
def combinations_count_mod(n, r):
    r = min(r, n - r)
    numer = reduce(lambda x,y: x*y%mod, range(n, n - r, -1), 1)
    denom = pow( reduce(lambda x,y: x*y%mod, range(1, r + 1), 1) , mod-2, mod)
    return numer * denom % mod


def solve():
    pass

def main():
    S = input().strip()
    N=len(S)
    temp=0
    for i in range(N):
        temp+=int(S[i])
        temp=temp%9
    if temp%9==0:
        ans="Yes"
    else:
        ans="No"
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = input()
    ans = 0
    for n in N:
        ans += int(n)
    if ans % 9 == 0:
        print("Yes")
    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())
judge = 0
for i in range(len(N)):
    judge += int(N[i])

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

Submission status: Accepted

Solution code:
import math
import itertools
import sys
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()
nc = str(n)
ans = 0
for i in nc:
    ans += int(i)
if ans % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#import numpy as np
#import collections
#import math

#f = open('./input_B.txt')
#
#f.readline()
#int(f.readline())
#map(int, f.readline().split())
#list(map(int, f.readline().split()))

#input()
N=int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = str(N)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
#N,X,T=map(int,input().split())
N=list(map(int,input()))

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re
import math
import itertools


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    N = I()

    NStr = str(N)

    keta = 0
    for n in NStr:
        keta += int(n)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

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


def solve(N: str):
    sum = 0
    for i in N:
        sum += int(i)
        if sum >= 9:
            sum -= 9
    print(YES if sum == 0 else NO)

    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = input()

is_multiple_of_9 = sum(map(int, list(N))) % 9 == 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# [] = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=list(map(int,input()))
cnt=0
for i in N:
    cnt+=i

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

Submission status: Accepted

Solution code:
import sys
import math
N=input()
num=0
for i in N:
    num+=int(i)
if num%9==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=input()

nn=list(map(int, n))

x=sum(nn)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Multiple of 9
N = input()
L = 0
for i in range(len(N)):
    L += int(N[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=input()

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import functools
n = list(map(int, list(input())))

def add(a, b):
    return a+b

if functools.reduce(add, n, 0) % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 176
# B - Multiple of 9

N=input()
ls=list(map(int,N))

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

Submission status: Accepted

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

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

if sum(s) % 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:
# vim: fileencoding=utf-8


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

def main():
    ans = 'Yes'
    n = int(input())
    if n%9 != 0:
        ans = 'No'
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()

nlist = [int(i) for i in n]
t = sum(nlist)

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

Submission status: Accepted

Solution code:
n = input()

s = sum(list(map(int, n)))

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

Submission status: Accepted

Solution code:
N = int(input())
# N = 10**(200000) - 1
if N%9:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
char = input()

num = 0
for c in char:
    num += int(c)
if num%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import copy
import math
import time
import statistics
import math
import itertools
import bisect
import sys
from decimal import *
from collections import deque


def get_int():
    return int(input())

def get_string():
    return input()

def get_int_list():
    return [int(x) for x in input().split()]

def get_string_list():
    return input().split()

def get_int_multi():
    return map(int, input().split())

def get_string_char_list():
    return list(str(input()))

# print("{} {}".format(a, b))
# a_list = [0] * a
sys.setrecursionlimit(10 ** 6)

def main():
    start = time.time()

    n = get_string()

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

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




    #print(ans)

    #print(time.time() - start)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
sums = sum([int(x) for x in input()])
print("Yes" if sums % 9 == 0 else "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()
ans = ['No', 'Yes'][(sum([int(e) for e in N]) % 9) == 0]
print(ans)

Submission status: Accepted

Solution code:
import math
# [int(i) for i in input().split(' ')]
n, = [int(i) for i in input().split(' ')]

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

x = sum([int(_) for _ in N])
if x % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

arr = [int(i) for i in  list(N)]

if sum(arr) % 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
input = sys.stdin.readline
N = int(input())
if N%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    num = 0
    MOD = 9
    N = list(map(int, list(input())))

    for d in N:
        num += d
        num %= 9
    
    if num:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=list(input())

ans_=0
for n in N:
    ans_+=int(n)
    
ans=ans_%9
# print(ans_,ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

list_N = list(str(N))
check = 0

for i in range(len(list_N)):
    check += int(list_N[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=str(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:
#!/usr/bin/env python3

n = str(input())

ans = 0
count = 1
for i in reversed(n):
    ans += int(i)
    ans = ans % 9
    count *= 10
if ans == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def B():
    n = input()
    ret = 0
    for d in n:
        ret += int(d)
    if ret % 9 == 0:
        print("Yes")
    else:
        print("No")
B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# map(int, input().split())

N = input()

d_total = 0
for d in N:
    d_total += int(d)

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

Submission status: Accepted

Solution code:
n = str(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:
s=input().rstrip()
a=0
for i in s:
  a+=int(i)
if a%9==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:

a = input()

x = 0

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

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

Submission status: Accepted

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

for s in S:
    ans += int(s)
    ans = ans % 9

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

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N = input().strip("\n")
    total = 0
    for i in range(len(N)):
        total += int(N[i])
        total %= 9
    if total == 0: print("Yes")
    else: print("No")

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
def main():
    L = input()
    s = 0
    for c in L:
        s += int(c)
        s = s % 9

    if s%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 = str(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:
from collections import defaultdict,deque
import math
def main():
    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")
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

Solution code:
N = input()

tmp = 0
for i in N:
    i = int(i)
    tmp = (tmp + i) % 9

if tmp == 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:
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N = input()
    ninesum = 0
    for i in N:
        ninesum += int(i)
    if ninesum % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n = sys.stdin.readline()[:-1]
v = sum([
    int(i)
    for i in n
])

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

Submission status: Accepted

Solution code:
n = input()

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

if sum%9 == 0:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

l=len(n)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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