checks if the input is a palindrome.