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):
"""
    Satwik_Tiwari ;) .
    21st AUGUST , 2020  - FRIDAY
"""



from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  
from itertools import combinations as comb 
from itertools import permutations as permutate
from bisect import bisect_left as bl


from bisect import bisect_right as br
from bisect import bisect





BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)





from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func





mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") 
def out(var): sys.stdout.write(str(var))  
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())

def zerolist(n): return [0]*n
def nextline(): out("\n")  
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def google(p):
    print('Case 
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     
    x = x % p  
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : 
            res = (res * x) % p

        y = y >> 1      
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True



@iterative
def dfs(v,visited,st,new):
    new.append(st)
    visited[st] = 1
    for i in v[st]:
        if(visited[i] == 0):
            ok = yield dfs(v,visited,i,new)
    yield True


def solve():
    s = inp()
    sum = 0
    for i in range(len(s)):
        sum+=int(s[i])

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






testcase(1)

Solution (Python):
N = list(map(str, input()))
N = [int(i) for i in N]
if sum(N)%9==0:
    print('Yes')
else:
    print('No')

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

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

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

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

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

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

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

Solution (Python):
N = list(str(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=str(input())

s=0

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

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

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

Solution (Python):
import sys
import math 


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

Solution (Python):
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    N = int(input())

    print('No') if N % 9 else print('Yes')

if __name__ == '__main__':
    main()

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

Solution (Python):
N=input()

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

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = s_input()

    len_n = len(n)

    count = 0

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

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

if __name__ == '__main__':
    main()

Solution (Python):
N = input()

S = 0
for a in N:
    A = int(a)
    S += A
    S = S % 9

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

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

Solution (Python):
import sys

input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
N = input()

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

print(['No','Yes'][s % 9 == 0])

Solution (Python):
n=input()
a=0
for i in range(len(n)):
    a+=int(n[i])
    a%=9
print('NYoe s'[a==0::2])

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

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

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

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

ans = 0

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

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):
N=input()
c=0
for i in range(len(N)):
  c+=int(N[i])
  
C=int(c)

if C%9==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=input()
print("Yes" if sum([int(i) for i in n])%9==0 else "No")

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

Solution (Python):
n = input()

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

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

Solution (Python):
n=int(input())
s=0
for i in str(n):
    s+=int(i)
while s>10000:
    a=0
    for i in str(s):
        a+=int(i)
    s=a
if s%9==0:
    print('Yes')
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):
A = input()
S = 0
for c in A:
    S += ord(c) - ord('0')
    S %= 9

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

Solution (Python):

import sys 
from collections import Counter,deque,defaultdict
from itertools import combinations,permutations,accumulate
from bisect import bisect_left,bisect
sys.setrecursionlimit(10**6)
INF = 10**9+7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode().rstrip()
N = len(S)
cnt = 0
for i in range(N):
    cnt += int(S[i])

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

Solution (Python):
s = input()
ans = 0
for x in s:
	ans += int(x)

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

Solution (Python):
N = input()
cnt = 0
for c in N:
    cnt += int(c)

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

Solution (Python):
n = input()

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

Solution (Python):
def main():
    N = str(input())
    sum = 0

    for val in N :
        sum = sum + int(val)

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




if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = input()

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


main()

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

s = input()
out = 0
for c in s:
    nn = int(c)
    out += nn
    out = out % 9

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

Solution (Python):

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

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

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

Solution (Python):

N = input()

gokei = sum([int(n) for n in N])


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

Solution (Python):
N = input()

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

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

Solution (Python):
import sys
input = sys.stdin.readline
import numpy as np

n = input().strip()
s = 0
for i in n:
    s += int(i)

if s % 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):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: str):
    a = 0
    for n in N:
        a+=int(n)
        a%=9
    if a==0:print(YES)
    else:print(NO)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = next(tokens)  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

INF = float("inf")


N = list(input())[:-1]
n = len(N)
b = 0
for i in range(n):
    s = N[i]
    a = int(s)
    b += a
    b %= 9
if b % 9 == 0:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache

sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


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

Solution (Python):
import sys
import math
N = list(input())

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

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

Solution (Python):
s = input()

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

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

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

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

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

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

str_N = str(N)

tmp = 0

for n in str_N:
    tmp += int(n)

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

Solution (Python):

N = str(input())

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

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

Solution (Python):
n=input()
sum=0
for i in n:
    sum+=ord(i)-ord('0')
if sum%9==0:
    print("Yes")
else:
    print("No")

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().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):
if sum(map(int,list(input())))%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()
amari = 0
for i in N:
    amari += int(i) % 9
    if amari >= 9:
        amari %= 9

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

Solution (Python):
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase


"""def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)"""

"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""



def inpt():
    return [int(k) for k in input().split()]


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


BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Solution (Python):

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

Solution (Python):
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n = I()
n = str(n)
res = 0
for elem in n:
    res += int(elem)
if res % 9 == 0:
    print('Yes')
else:
    print('No')

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

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


def main(input, print):
    s = list(input().strip())
    ans = 0
    for i in range(len(s)):
        ans += int(s[i])
    if ans % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main(sys.stdin.readline, print)

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

Solution (Python):
S = input()

digit_sum = 0

for c in S:
    digit_sum += int(c)

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

Solution (Python):
'''
Created on 2020/08/22

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=pin()[:-1]
  N=list(map(int,N))
  if sum(N)%9==0:
    print("Yes")
  else:
    print("No")
  return 
main()

Solution (Python):

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

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

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

Solution (Python):


from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float('inf')


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


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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

S = input()
s = sum(int(x) for x in S)
if s % 9 == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()

ans = 0

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

Solution (Python):

import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]









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

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

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = input()

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

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

Solution (Python):

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

Solution (Python):
N = input()

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

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

Solution (Python):

N=int(input())
if N%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):
import bisect,collections,copy,itertools,math,string
import sys
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 = S()
    n = list(n)
    n = list(map(int,n))
    s = sum(n)
    if s%9 == 0:
        print("Yes")
    else:
        print("No")
main()

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

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

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

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

Solution (Python):
def main():
    S = list(input())
    su = 0
    for d in S:
      su += int(d)

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

if __name__ == "__main__":
    main()

Solution (Python):
s = input()

v = 0
for c in s:
    v += int(c)
    v %= 9

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

Solution (Python):
n = input()
a = 0

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

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

Solution (Python):

 

 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy


 











N=int(input())

string = str(N)
ans = 0

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

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

Solution (Python):
def main():
    N = list( map( int, list( input())))
    nine = sum(N)
    if nine%9 == 0:
        print("Yes")
    else:
        print("No")
if __name__ == '__main__':
    main()

Solution (Python):
'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前
sort()
sorted(reverse=true)
配列の初期化
配列名=[a]*n+[b]*m
Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter
import itertools
import fractions
import sys

n = stdin.readline().rstrip()
num = 0
for el in n:
    num += int(el)
if num % 9 == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
n = input()
res = 0

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

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

Solution (Python):






N = input()





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

Solution (Python):
def main():
    N = input()
    ans = 0
    for ch in N:
        ans += int(ch)

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


if __name__ == "__main__":
    main()

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

Solution (Python):
N = input()

L = len(N)

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

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

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

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

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

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

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

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = SS()

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

if __name__ == '__main__':
    resolve()

Solution (Python):
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    N = SI()
    x = 0
    for i in N:
        x += int(i)
    if x % 9:
        print('No')
    else:
        print('Yes')



if __name__ == '__main__':
    main()

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

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