#include<bits/stdc++.h>
using namespace std;
bool hw( string x ){
bool f = 1 ;
for( int i = 0 ; i <= (x.size()-1) /2 ; i++ ){
if( x[i] != x[x.size()-1-i] ){
f = 0 ;
break;
}
}
return f ;
}
int main(){
int n ;
cin >> n ;
string s ;
while( n-- ){
cin >> s ;
bool bj = 1 ;
for( int i = 2 ; i <= s.size()-2 ; i++ ){
string q = s.substr(0, i ) ;
string h = s.substr(i) ;
if( hw(q) == 1 && hw(h) == 1 ){
cout<< "Yes"<< endl ;
bj = 0 ;
break;
}
}
if( bj == 1 ){
cout<< "No"<< endl;
}
}
return 0 ;
}