#include<bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int jud(char p[],int x) {
int k = strlen(p)-1;
for (int i = 0; ; i++) {
if (i > k)break;
if (i == x)continue;
else if (k == x) {
k--, i--; continue;
}
if (p[i] == p[k])k--;
else return 0;
}
return 1;
}
int main() {
int t;
cin >> t;
while (t--) {
char p[1100];
cin >> p;
int is = 0;
if (jud(p, inf) == 1) {
printf("Yes\n");
continue;
}
for (int i = 0; i < strlen(p); i++) {
if (jud(p, i) == 1) {
printf("Yes\n");
is = 1;
break;
}
}
if (!is)printf("No\n");
}
return 0;
}