def main():
#code here
# //1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# //1 3 5 7 9 11 13 15 17 19
# //1 3 7 9 13 15 19
# //1 3 7 9 15 19
# //1 3 7 9 19
n = int(input())
count = 2
while(count <= n):
if(n % count ==0 ):
print('NO')
break
n -= (n // count )
count+=1
if count > n: print('YES')
pass
if __name__ == '__main__':
main();