```
class Solution(object):
def isOneBitCharacter(self, bits):
"""
:type bits: List[int]
:rtype: bool
"""
if bits[-1] != 0:
return False
bits = bits[:len(bits)-1]
index = 0
while index < len(bits):
if bits[index] == 0:
index += 1
elif bits[index] == 1:
index += 2
return index == len(bits)
```