#include <iostream
#include <string>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
string s;
cin >> s;
int n = s.length();
int fq[26] = {};
for(int i=0; i<n/2; i++)
++fq[s[i]-'a'], --fq[s[n-1-i]-'a'];
bool f = true;
for(int i=0; i<26; i++)
if(fq[i])
{
f = false;
break;
}
cout << ((f) ? "YES" : "NO") << "\n";
}
return 0;
}