N = int(input()) print("Yes" if N % 6 == 0 or N < 6 else "No")