N = int(input()) if not N % 6: print("Yes") else: print("No")