P = int(input()) mod = P % 8 print("YES" if mod in {1, 7} else "NO")