#include <iostream> #include<string> using namespace std; void replace_all(string& str, const string& from, const string& to) { size_t pos = 0; while ((pos = str.find(from, pos)) != string::npos) { str.replace(pos, from.length(), to); pos += to.length(); } } int main() { int T; cin>>T; while(T--) { string s; cin>>s; replace_all(s,"w","vv"); replace_all(s,"p","b"); replace_all(s,"d","b"); replace_all(s,"q","b"); replace_all(s,"u","n"); replace_all(s,"m","nn"); bool is_not_enter=true; for(int l=0,r=s.length()-1;l<=r;l++,r--) { if(s[l]!=s[r]) is_not_enter=false; } if(is_not_enter) cout<<"YES"<<endl; else cout<<"NO"<<endl; } } // 64 位输出请用 printf("%lld")