```
class Solution:
# @param {integer} n
# @return {boolean}
def isPowerOfTwo(self, n):
if n <= 0:
return False
x = bin(n)[2:]
sum = 0
for i in x:
sum += int(i)
if sum>1:
return False
else:
return True
```