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

Solution (Python):
S = input()

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

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

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

Solution (Python):
N = input()

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

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    n = input()
    s = sum(int(c) for c in n)
    if s % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
from math import ceil
from collections import defaultdict as dd
import sys
input=sys.stdin.readline

n=input().split()[0]
su=0
for i in n:
    su=(su+int(i))%9
if(su==0):
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
N = str(input())
tmp = 0
for i in N:
    tmp += int(i)

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

Solution (Python):
from math import *

s=input()

val=0
for i in s:
	val=val+int(i)

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

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

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

Solution (Python):
N=int(input())

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

Solution (Python):
N=input()
count=0
for n in N:
    count+=int(n)
print('YNeos'[count%9>0::2])

Solution (Python):

import sys, io, os, re
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop



n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]
def linc(A, d=1): return map(lambda x: x + d, A)
def ldec(A, d=1): return map(lambda x: x - d, A)

N = s1()

r = 0
for c in N:
    r += int(c)
    r %= 9

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

Solution (Python):
n = input()

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

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

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

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

Solution (Python):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = input()
    if sum(int(c) for c in N)%9 == 0:
        return 'Yes'
    return 'No'


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

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

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

Solution (Python):
s=input()

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

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

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

Solution (Python):
N = input()

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

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

Solution (Python):
n = input()

total = 0
for s in n:
    v = int(s)
    total += v

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

Solution (Python):
a = input()

s = 0
for x in a:
    s += int(x)
    s %= 9

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

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

Solution (Python):
N = input()

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

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

Solution (Python):


def solve():
    S = input()
    total = 0
    for s in S:
        total += int(s)

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


if __name__ == "__main__":
    solve()

Solution (Python):
LI = lambda: list(map(int, input().split()))

N = input()


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


if __name__ == "__main__":
    main()

Solution (Python):
N = input()

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

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

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

Solution (Python):
strN = input().rstrip()

s = 0
for Ni in strN:
    Ni = int(Ni)
    s += Ni
    s %= 9

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

Solution (Python):
n = input()

ans = 0

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

Solution (Python):
N = str(input())

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

Solution (Python):
N = int(input())

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

Solution (Python):
n = int(input())
l = list(str(n))

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

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

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

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

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


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

n = int(input())










str_n = str(n)

tot = 0

for ch in str_n:
    tot += int(ch)

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

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

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

Solution (Python):
N = str(input())
count = 0

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

Solution (Python):
n=input()
mod=9
ans=0

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

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

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

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

Solution (Python):
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")

Solution (Python):
import sys
import math
from collections import defaultdict, deque
from copy import deepcopy
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
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 Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = input().rstrip()
    ans = 0
    for i in range(len(N)):
        ans += int(N[i])
    if ans % 9 == 0:
        print("Yes")
    else:
        print("No")
if __name__ == "__main__":
    main()

Solution (Python):
N = list(input())
total = 0
for i in range(len(N)):
    total += int(N[i])
    total = total % 9

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

Solution (Python):
N = input()

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

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

Solution (Python):

MOD = 10 ** 9 + 7
INFI = 10**10

import math
from collections import deque
import itertools
import heapq

from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint




def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default




def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

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




if __name__ == "__main__":

    main()

Solution (Python):
import math
import re



s=input()
atemp=0
for i in range(len(s)):
    atemp+=int(s[i])
if atemp%9==0:
    print("Yes")
    exit()

print("No")

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

Solution (Python):

import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


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


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


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

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


main()

Solution (Python):
def main():
    import sys
    S=sys.stdin.readline().strip()
    k=0
    for a in S:
        k+=int(a)

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

main()

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

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
from bisect import bisect_left


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

def bindex(a,x):
    i = bisect_left(a,x)
    if i != len(a) and a[i] == x:
        return i
    return None

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    N = intinput()
    judge = N%9==0
    print(yn[not judge::2])

Solution (Python):

N = list(input()) 

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

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

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

Solution (Python):
import sys
import math

if __name__ == '__main__':
    N = int(sys.stdin.readline())
    r = N % 9
    if r == 0:
        print('Yes')
    else:
        print('No')

Solution (Python):
nl = list(input())



total=0
for v in nl:
    v2=int(v)
    total+=v2
if total%9==0:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
N = input()

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

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

Solution (Python):
A = list(map(int, list(input())))

n = sum(A)

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

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False



def main():
    s = S()
    ans = 0

    for t in s:
        ans += int(t)

    print(yn[ans % 9 == 0])


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
print('YNeos'[sum(int(i) for i in input())%9>0::2])

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

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

Solution (Python):
N = input()

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

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

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

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

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

Solution (Python):
N = input()

sum = 0

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

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

Solution (Python):
n = list(input())
ans=0
for i in range(len(n)):
    ans+=int(n[i])

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

Solution (Python):
def main():
    n = int(input())
    total = 0
    for i in str(n):
        total+=int(i)
    if total%9==0:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Solution (Python):
n=list(input())

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

Solution (Python):
N = input()

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

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

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

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

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

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

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

Solution (Python):
import sys


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


def main():
    a = 0
    for c in _s():
        a = (a + int(c)) % 9
    return 'Yes' if a == 0 else 'No'


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

Solution (Python):
N = input()
cur = 0
for x in N:
    cur += int(x)%9
    cur %= 9
cur %= 9
if cur == 0:
    print('Yes')
else:
    print('No')

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

Solution (Python):
def main():
    n = int(input())
    s = str(n)
    m = sum(int(i) for i in list(s))
    print('Yes' if m % 9 == 0 else 'No')


if __name__ == '__main__':
    main()

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

Solution (Python):
n=input()
sm=0
for i in n:
    a=int(i)
    sm+=a
    sm%=9

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

Solution (Python):
n = int(input())

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

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

Solution (Python):

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

Solution (Python):
n = input()

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

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

Solution (Python):
n = int(input())

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

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

Solution (Python):
wa = 0
for i in input():
    wa += int(i)
    wa %= 9

if wa == 0:
    print('Yes')

else:
    print('No')

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

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

Solution (Python):
N = str(input())
now = 0
for i in range(len(N)):
    now += eval(N[i])
if now % 9 == 0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
n = input()
s = 0
for i in n:
    s += int(i)
print(['No','Yes'][s%9==0])

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

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:input()

"""========main code==============="""
t=1

for _ in range(t):
    n=ip()
    ans=0
    for i in n:
        ans+=ord(i)-ord('0')
    if(ans%9==0):
        print("Yes")
    else:
        print("No")

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

Solution (Python):
import sys
sys.setrecursionlimit(10**7) 
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque, defaultdict


from collections import Counter

from itertools import accumulate,combinations,permutations,product

from heapq import heapify,heappop,heappush

from functools import reduce,lru_cache

from decimal import Decimal
from argparse import ArgumentParser

args=ArgumentParser()
args.add_argument('-loc', '--local', type=bool,default=False)
LOCAL=args.parse_args().local

def input(): 
    x=sys.stdin.readline(); 
    if x[-1]=="\n": 
        return x.rstrip() 
    return x
    
def printe(*x):_=print("
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): 
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    

    
    
    
    
    
    s=input()
    cnt=0
    for si in s:
        cnt+=int(si)
    if cnt%9==0:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

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

Solution (Python):
n = int(input())

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

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

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

Solution (Python):
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = input()

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

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

Solution (Python):
N = list(input())
print(['No','Yes'][sum(int(T) for T in N)%9==0])

Solution (Python):
import sys, math
import io, os





def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var) : sys.stdout.write(' '.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')
from decimal import Decimal


INF = float('inf')
mod = int(1e9)+7

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

Solution (Python):
n = input()
s = 0
for num in n:
    s += int(num)

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

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

Solution (Python):
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
import copy


MOD = 10 ** 9 + 7



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

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

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

Solution (Python):
n = list(input())
l = [int(i) for i in n]

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

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

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

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

Solution (Python):
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
import copy


n = input()


a = 0

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

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

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

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

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

Solution (Python):
N = input()

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

Solution (Python):
n = input()

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

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

Solution (Python):
N = int( input() )

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

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

Solution (Python):
N=input()
ans = 0
for n in N:
    ans = (ans + int(n))%9

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