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