#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using i128=__int128_t;
using u128=__uint128_t;
using ld=long double;
void solve()
{
string s,t;
cin >> s;//易知字符的形状能变 位置不能变 我们可以把能变的字符统一变成一样的状态 再遍历看是否回文即可
for(int i=0;i<s.size();i++)//以下是模拟
{
if(s[i]=='w')
{
t.append("v");
t.append("v");
}
else if(s[i]=='m')
{
t.append("n");
t.append("n");
}
else if(s[i]=='b'||s[i]=='d'||s[i]=='p'||s[i]=='q')
{
t.append("b");
}
else if(s[i]=='n'||s[i]=='u')
{
t.append("n");
}
else
{
string temp="a";
temp[0]=s[i];
t.append(temp);
}
}
for(int i=0;i<t.size()/2;i++)
{
if(t[i]!=t[t.size()-1-i])
{
cout << "NO" << "\n";
return;
}
}
cout << "YES" << "\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t=1;
cin >> t;
while(t--)
{
solve();
}
return 0;
}