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