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.
def f(n):
    rl = [True]*n   #True = nonvisited
    nn = (n*(n-1))//2
    for k in range(n):
        kk = (k*(k+1))//2
        rl[kk%n] = False
        if n%2==0:
            rl[(kk+nn)%n] = False
    return sum(rl)==0
