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