If the given number is less than 5,only 4 can make Nim win the game.

Otherwise, whatever Nim takes (n) we can take 4-n makes the game back to the less-than-5 situation.

For Nim,the game strategy is the same.

Judging the num%4 is the key.

```
class Solution(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
return n>>2<<2!=n
```

or

```
class Solution(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
return n%4!=0
```