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