import sys stdin = sys.stdin mod = 10**9 + 7 def ns(): return stdin.readline().rstrip() def ni(): return int(ns()) def na(): return list(map(int, stdin.readline().split())) N = ni() print("Yes" if N % 6 == 0 else "No")