#K94357. Almost Palindrome

    ID: 38623 Type: Default 1000ms 256MiB

Almost Palindrome

Almost Palindrome

Given a string s, determine whether it can be transformed into a palindrome by deleting at most one character. For instance, the string abca can become a palindrome if either the character 'b' or 'c' is removed.

Your task is to process multiple test cases. For each test case, output "YES" if the string can be transformed into a palindrome by deleting at most one character, otherwise output "NO".

inputFormat

The first line contains an integer T representing the number of test cases. Each of the next T lines contains a single string s.

Constraints: 1 ≤ T ≤ 105; for each string, 1 ≤ |s| ≤ 105; and the total length of all strings does not exceed 106.

outputFormat

For each test case, print a single line containing "YES" if the string can be transformed into a palindrome by deleting at most one character. Otherwise, print "NO".

## sample
1
a
YES

</p>