X=int(eval(input()))

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

print(("YES" if eval(input()) in "357" else "NO"))

-X = int(eval(input())) -print(("YES" if (X == 3) or (X == 5) or (X == 7) else "NO")) +print(("YES" if eval(input()) in "357" else "NO"))