#K60612. Palindrome Checker

    ID: 31126 Type: Default 1000ms 256MiB

Palindrome Checker

Palindrome Checker

In this problem, you are given a series of strings provided via standard input. Your task is to determine whether each string is a palindrome. A palindrome is a string that reads the same backward as forward. For example, "racecar" and "level" are palindromes, whereas "hello" is not. The input terminates with the string "end" (which should not be processed).

The palindrome check is defined as: ( s = \text{reverse}(s) ). Make sure your solution reads from standard input and writes to standard output.

inputFormat

The input consists of multiple lines. Each line contains a single string. The input terminates when a line containing exactly "end" is encountered. Do not process this terminator line.

outputFormat

For each input string (excluding the terminating "end"), output a single line. Print "Yes" if the string is a palindrome, otherwise print "No".## sample

racecar
hello
level
end
Yes

No Yes

</p>