```
class Solution(object):
def isPalindrome(self, head):
node, result = isPalindromHelper(head, head)
return result
def isPalindromHelper(forward, backward):
if not forward or not backward:
return (None,True)
if backward and not backward.next:
return (forward.next, forward.val == backward.val)
node, bool_val = isPalindromHelper(forward, backward.next)
return (node.next, node.val == backward.val and bool_val)
```