Advertisement
Korotkodul

21-22_N1

Mar 22nd, 2023
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. N = int(input())
  2. s = bin(N)[2:]
  3. a = []
  4. for i in s:
  5.     a.append(int(i))
  6.  
  7. import sys
  8.  
  9. #print(s)
  10.  
  11. for i in range(len(a) - 1):
  12.     if a[i + 1] != (a[i] + 1) % 2:
  13.         print("NO")
  14.         sys.exit()
  15.  
  16. print("YES")
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement