#include<bits/stdc++.h>
using namespace std;
void lapindrome(string a){
int mid=0;
int count=0;
if(a.size()%2==0){
mid = a.size()/2;
for(int i=0; i<mid; i++){
for(int j=mid; j!=(a.size()); j++){
if(a[i]==a[j]){
count=count+1;
}
else{
continue;
}
}
}
if(count==mid){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
else{
mid = (a.size()+1)/2;
for(int i=0; i<(mid-1); i++){
for(int j=mid; j!=(a.size()); j++){
if(a[i]==a[j]){
count=count+1;
}
else{
continue;
}
}
}
if(count==(mid-1)){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
}
int main(){
string S=" ";
int T=0;
cin>>T;
while(T–){
cin>>S;
lapindrome(S);
}
return 0;
}
//Somebody pls help me realize what’s wrong in this code…