```
class Solution:
# @param {ListNode} head
# @return {boolean}
def isPalindrome(self, head):
node = head
length = 0
comp = []
while node:
comp.append(node.val)
node = node.next
length += 1
for i in range(length // 2):
if not comp[i] == comp[len(comp)-i-1]:
return False
return True
```