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