#include<bits/stdc++.h>
using namespace std;
const int MAX_CHAR=26;
bool check(string s)
{
int count[MAX_CHAR]={0};
int n=s.length();
if(n==1)
return true;
for(int i=0,j=n-1;i<j;i++,j--)
{
count[s[i]-'a']++;
count[s[j]-'a']--;
}
for(int i=0;i<MAX_CHAR;i++)
{
if(count[i]!=0)
return false;
else
return true;
}
}
int main()
{
int t;
cin>>t;
getchar();
string s[t];
for(int i=0;i<t;i++)
{
getline(cin,s[i]);
}
for(int i=0;i<t;i++)
{
string str=s[i];
if(check(str))
cout<<"YES\n";
else
cout<<"NO\n";
}
return 0;
}