number=int(input())
for n in range(number):
    string1=input()
    str_l=list(string1)
    for num,i in enumerate(str_l):
        if i == 'w':
            str_l[num]='vv'
        elif i=='m':
            str_l[num]='nn'
        elif i in ['d','q','p']:
            str_l[num]='b'
        elif i=='u':
            str_l[num]='n'
        else:
            continue

    newstr=''.join(str_l)
    l=len(newstr)
    if newstr[::-1]==newstr:
        print('YES')
    else:
        print('NO')