A flea is sitting at one of the *n* hassocks, arranged in a circle, at the moment. After minute number *k* the flea jumps through *k* - 1 hassoсks (clockwise). For example, after the first minute the flea jumps to the neighboring hassock. You should answer: will the flea visit all the hassocks or not. We assume that flea has infinitely much time for this jumping.
The only line contains single integer: 1 ≤ *n* ≤ 1000 — number of hassocks.
n = int(input())
jumped = [ [ False for j in range(n) ] for i in range(n) ]
seen = [ False for i in range(n) ]
seen[0] = True
count = 1
span = 0
pos = 0
while True:
	pos = (pos + span + 1) % n
	if seen[pos]:
		if jumped[pos][span]:
			break
	else:
		seen[pos] = True
		count += 1
	jumped[pos][span] = True
	span = (span + 1) % n

if count == n:
	print('YES')
else:
	print('NO')
