INF = 10 ** 7 import sys input = sys.stdin.readline sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from bisect import bisect_left def main(): n = int(input()) if n%6 == 0: print('Yes') else: print('No') if __name__ == '__main__': main()