N = int(input()) ret = ["Yes" if N % 6 == 0 else "No"] p = list(map(print, ret))