Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N = int(input())
- s = bin(N)[2:]
- a = []
- for i in s:
- a.append(int(i))
- import sys
- #print(s)
- for i in range(len(a) - 1):
- if a[i + 1] != (a[i] + 1) % 2:
- print("NO")
- sys.exit()
- print("YES")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement