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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print('Yes' if sum(int(ni) for ni in n) % 9 == 0 else 'No')

Submission status: Accepted

Solution code:
a=input()
m=0
for i in a:
  m += ord(i)-ord('0')
  m %= 9
if m==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    n = map(int, list(input()))
    ret = 0
    for i in n:
        ret += i
        ret %= 9
    if ret == 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = input().strip("¥n")

summ9= 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

n = list(N)

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

s = sum(n)

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

Submission status: Accepted

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

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

ans = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

sum_n = 0

for n_i in n:
  sum_n += int(n_i)

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

k = [ int(num) for num in N]
ans = 'Yes' if sum(k)%9==0 else 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

s = str(N)
sum = 0
for c in s:
    sum += int(c)

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

Submission status: Accepted

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

N=input()
S=0
for n in N:
    S+=int(n)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    s = list(input())
    sum = 0
    for i in s:
        I = int(i)
        sum += I
    if sum % 9 == 0:
        print('Yes')
    else:
        print('No') 

    

    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    n_s = list(input())

    ans = 0
    for n in n_s:
        ans += int(n)

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


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """123456789"""
        output = """Yes"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """0"""
        output = """Yes"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """31415926535897932384626433832795028841971693993751058209749445923078164062862089986280"""
        output = """No"""
        self.assertIO(test_input, output)

    # 自作テストパターン
    def test_original(self):
        pass


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

N=readline().rstrip()

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

Submission status: Accepted

Solution code:
N = 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
import numpy as np
import math  # gcdもあるよ
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

def main():
    n = list(input())
    ans = 0
    for i in n:
        ans += int(i)
        if ans >= 9:
            ans -= 9
    if ans == 0 or ans % 9 == 0:
        print('Yes')
    else: print('No')
    
    return 0

if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list1 = list(map(int, input().split()))
Sum = 0
for x in list1:
    Sum += x
if Sum % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N =  str(input())

tmp = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

@author: NEC-PCuser
"""

N = input()

sum_c = 0
for c in N:
	sum_c += int(c)

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
N = input()

list_N = list(N)

tmp = 0
for i in list_N:
    i = int(i)
    tmp += i

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

else:
    print("No")

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = input()

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def std_in():
    return sys.stdin.readline().strip()


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys,math
try:sys.stdin,sys.stdout=open('input.txt','r'),open('out.txt','w')
except:pass
from time import clock
a=clock()
from sys import stdin,stdout;mod=int(1e9 + 7);from statistics import mode
from collections import *;from math import ceil,floor,inf,factorial,gcd,log2,sqrt,log
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
# print('{:.3f}'.format(1),round(1.123456789,4))
# sys.setrecursionlimit(500000)
def lcm(a,b): return (a*b)//gcd(a,b)
def setbits(n):return bin(n).count('1')
def resetbits(n):return bin(n).count('0')
def modinv(n,p):return pow(n,p-2,p)
def ncr(n,r):
    num,den=1,1;r=min(n,n-r)
    for i in range(r):num*=(n-i);den*=(i+1)
    return num//den
def ncr_p(n, r, p):
    num,den=1,1;r=min(r,n-r)
    for i in range(r):num = (num * (n - i)) % p ;den = (den * (i + 1)) % p
    return (num * modinv(den,p)) % p
def isPrime(num) :
    if num<=1:return False
    if num==2 or n==3:return True
    if (num % 2 == 0 or num % 3 == 0) :return False
    m = int(num**0.5)+1
    for i in range(5,m,6):
        if (num % i == 0 or num % (i + 2) == 0) :return False
    return True
def bin_search(s, low, high, val):
    while low <= high:
        mid = low + (high - low) // 2;
        if s[mid] == val:return mid
        elif s[mid] < val:low = mid + 1
        else:high = mid - 1
    return -1
def sumofdigit(num):
    count=0;
    while num : count+=num % 10;num //= 10;
    return count;
def inputmatrix():
    r,c=iia();mat=[0]*r;
    for i in range(r):mat[i]=iia();
    return r,c,mat;
def prefix_sum(n,s):
    for i in range(1,n):s[i]+=s[i-1]
    return s;
def binomial(n, k):
    if 0 <= k <= n:
        ntok = 1;ktok = 1
        for t in range(1, min(k, n - k) + 1):ntok *= n;ktok *= t;n -= 1
        return ntok // ktok
    else:return 0
def divisors(n):
    res = [];
    for i in range(1,ceil(sqrt(n))+1):
        if n%i == 0:
            if i==n//i:res.append(i)
            else:res.append(i);res.append(n//i)
    return res;
# code here---
s=is1()
ans=0
for i in s:
    ans+=int(i)
if ans%9==0:print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
def resolve():
    b = [int(x) for x in list(str(input()))]
    if sum(b)%9==0:
        print("Yes")
    else:
        print("No")
resolve()

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = input()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n = str( input() )

ans = 0
for c in n:
    ans += int( c )
    ans = ans % 9

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''

    N = input()

    sum_num = 0
    for item in N:
        sum_num += int(item)

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file=1




def solve():
    
    
    

    s = si()
    s1 = 0
    for i in s:
        s1 += int(i)

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














        
if __name__ =="__main__":

    if(file):

        if path.exists('input.txt'):
            sys.stdin=open('input.txt', 'r')
            sys.stdout=open('output.txt','w')
        else:
            input=sys.stdin.readline
    solve()

Submission status: Accepted

Solution code:
n=input()

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

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

Submission status: Accepted

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
    # combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

def readInt():
    return list(map(int,input().split()))

def main():
    n = input()
    res = 0
    for i in range(len(n)):
        res += int(n[i])
    if res%9==0:
        print("Yes")
    else:
        print("No")
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = list(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())
if N%9 ==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input()
count = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import sys
# readline = sys.stdin.readline
# generator = (readline().strip() for _ in range(N))

# N, M = map(int, input().split())
# As = list(map(int, input().split()))
# queries = (input() for _ in range(N))


def solve():
    n = input()
    t = 0
    for s in n:
        t += int(s)

    return ['Yes', 'No'][t % 9 != 0]


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
N = [0]*len(n)
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:
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    r = sum([int(i) for i in n])
    res = "No"
    if r % 9 == 0:
        res = "Yes"
    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = cin[0]

    cout = main(kwargs)
    print(cout)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
def LI(): return list(map(int, input().split()))
def I(): return map(int, input().split())
mod = 10**9 + 7

def main():
  n = input()
  x = len(n)
  ans = 0
  for i in range(x):
    ans += int(n[i])
  if ans%9 == 0:
    print('Yes')
  else:
    print('No')
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import sys

Nstr = sys.stdin.readline().strip()

tmp = 0
for n_i in Nstr:
    tmp += int(n_i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

# def
def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return x

def str_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return x

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

def int_list():
    return list(map(int,input().split()))

def print_space(l):
    return print(" ".join([str(x) for x in l]))

# import
import numpy as np



# main code
N = input()

Ns = str(N)

a = 0

for i in range(0,len(Ns)):
    a += int(Ns[i])

if a%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:
N = [int(x) for x in input()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m = 0
for i in range(n):
    m += int(s[i])

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
number = input()

sum_digit = 0

for digit in number:
    sum_digit += int(digit)

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

print(ans)

Submission status: Accepted

Solution code:
import sys
N=sys.stdin.readline().strip()
t=0
for x in N:
    t+=int(x)
if t%9==0:
    print "Yes"
else:
    print "No"

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Author: M@sud_P@rvez
from math import *

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

Submission status: Accepted

Solution code:
N_str = input()

sum_ = 0
for c in N_str:
    sum_ += int(c)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = list(input())
Y = [int(i) for i in X]
ans = 0
for j in Y:
  ans += j
  ans %= 9
if ans == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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:
import sys,bisect

from sys  import stdin,stdout

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

from math import gcd,ceil,floor,sqrt

from collections import Counter,defaultdict,deque,OrderedDict

from queue import Queue,PriorityQueue

from string import ascii_lowercase

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

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


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

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

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

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

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


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

                


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

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

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r
    
def solve():
    n=input()
    s=sum(list(map(int,str(n))))
    if s%9==0:
        pr('Yes')
    else:
        pr('No')

    




for _ in range(1):
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

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

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