n = int(input()) n %= 8 if n == 0 or n == 7: print("Yes") else: print("No")