Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/string-palindrommi

Palindrome string

Easy 1000 ms 128 MB 28%
Share

A string $s$ of lowercase Latin letters is given. Determine whether it reads the same left to right and right to left (whether it is a palindrome).

Comparing the characters of the string in pairs from the edges to the center

Input

One line containing the string $s$.

Output

YES if it is a palindrome, otherwise NO.

Note

$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters (a–z) only

Examples

Input #1
kiyik
Output #1
YES
Input #2
algor
Output #2
NO

Sign in to submit a solution

Signing up is free and takes a minute.