codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

55A.md (805B)


      1 Source: https://codeforces.com/problemset/problem/55/A
      2 
      3 A. Flea travel
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 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.
     22 
     23 Input
     24 
     25 The only line contains single integer: 1 ≤ *n* ≤ 1000 — number of hassocks.
     26 
     27 Output
     28 
     29 Output "YES" if all the hassocks will be visited and "NO" otherwise.
     30 
     31 Examples
     32 
     33 Input
     34 
     35 ```
     36 1
     37 ```
     38 
     39 Output
     40 
     41 ```
     42 YES
     43 ```
     44 
     45 Input
     46 
     47 ```
     48 3
     49 ```
     50 
     51 Output
     52 
     53 ```
     54 NO
     55 ```