X = int(eval(input()))

print(('YES' if X in (3,5,7) else 'NO'))
X = int(eval(input()))

print(('YES' if X in (7,5,3) else 'NO'))
X = int(eval(input()))
print(("YES" if X in (3, 5, 7) else "NO"))

X = int(eval(input()))
print(("YES" if X in (7, 5, 3) else "NO"))

-print(("YES" if X in (3, 5, 7) else "NO")) +print(("YES" if X in (7, 5, 3) else "NO"))