output_description: If N is a multiple of 9, print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: import sys
  
  sys.setrecursionlimit(10**9)
  
  
  # input = sys.stdin.readline    ####
  def int1(x):
      return int(x) - 1
  
  
  def II():
      return int(input())
  
  
  def MI():
      return map(int, input().split())
  
  
  def MI1():
      return map(int1, input().split())
  
  
  def LI():
      return list(map(int, input().split()))
  
  
  def LI1():
      return list(map(int1, input().split()))
  
  
  def LLI(rows_number):
      return [LI() for _ in range(rows_number)]
  
  
  def MS():
      return input().split()
  
  
  def LS():
      return list(input())
  
  
  def LLS(rows_number):
      return [LS() for _ in range(rows_number)]
  
  
  def printlist(lst, k=" "):
      print(k.join(list(map(str, lst))))
  
  
  INF = float("inf")
  # from math import ceil, floor, log2
  # from collections import deque, defaultdict
  # from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
  # from heapq import heapify, heappop, heappush
  # import numpy as np    # cumsum
  # from bisect import bisect_left, bisect_right
  
  
  def solve():
      N = input()
      S = list(str(N))
  
      sm = 0
      for s in S:
          n = int(s)
          sm += n
  
      if sm % 9 == 0:
          print("Yes")
      else:
          print("No")
  
  
  if __name__ == "__main__":
      solve()
  
problem_description: 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.
samples: [{"input": "123456789", "output": "Yes\n    \n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so\n123456789 is a multiple of 9.\n\n* * *"}, {"input": "0", "output": "Yes\n    \n\n* * *"}, {"input": "31415926535897932384626433832795028841971693993751058209749445923078164062862089986280", "output": "No"}]