P20498 [HackerEarth] A string is called a palindrome if it may be read the same way in either direction. For example, “12321” is a palindrome, but “12341” is not. A palindrome string can itself compose of on
普及
题目描述

A string is called a palindrome if it may be read the same way in either direction. For example, “12321” is a palindrome, but “12341” is not. A palindrome string can itself compose of one or more palindrome sub-strings. Now, your task is to find out the length (denoted by L) of the longest palindrome sub-string, maximum-length contiguous substring of a given string that is also a palindrome, and print "YES" if it is lucky otherwise print "NO". A palindrome sub-string is called lucky iff it's length is a prime number.
For example : Consider a string s =”122321”. The longest palindrome sub-strings in s is of length 3. Hence, you need to output "YES" (quotes only for clarity).

Input :

The first line of input contains an integer T, the number of test cases. Then T test cases follow. Each test case consists of a line containing the string s.

Output :

Output on a new line the count as asked to determine in the problem statement.

Constraints :

1 ≤ T ≤ 100  

1 ≤ L ≤1000 , L - length of the string s.

SAMPLE INPUT
1
122321

SAMPLE OUTPUT
YES

输入格式

见题面

输出格式

见题面

样例输入
26 8813200023188 187 968 1837 9218 17347 91718 173437 907808 1716517 8872688 17735476 85189247 159487405 664272356 1317544822 3602001953 7193004016 13297007933 47267087164 93445163438 176881317877 955594506548 1801200002107 8813200023188 9104495467417656552982698022556296323012072552812103235826563197972803556567037646054008
样例输出
YES NO YES YES NO YES NO NO YES YES