import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @author supermejane
 * @date 2025/10/3
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();
        while (n-- > 0) {
            String s = in.nextLine();
            //System.out.println(s);
            s = init(s);
            //System.out.println("inited: " + s);
            System.out.println(isReversable(s) ? "YES" : "NO");
        }
    }

    public static HashMap<String, String> map = new HashMap<>();
    static {
        //map.put("W", "VV");
        map.put("w", "vv");
        map.put("m", "nn");
        map.put("u","n");
        map.put("b", "q");
        map.put("p", "q");
        map.put("d", "q");
    }

    public static String init(String s) {
        for (Map.Entry<String, String> e:
             map.entrySet()) {
            s = s.replaceAll(e.getKey(), e.getValue());
        }
        return s;
    }
	
    public static boolean isReversable(String s) {
        int i = 0, j = s.length() - 1;
        while (j > i) {
            if (s.charAt(i++) != s.charAt(j--)) return false;
        }
        return true;
    }
}
//1.直接统一换成相同的(本题只考虑小写) 2.判断是不是回文串