isPalindrome for binary string