#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define int long long 
#define fi first 
#define se second 
#define mp make_pair 
#define pb push_back 
typedef pair<int, int >ii;
typedef pair<int, ii> iii;
const int INF = 1e15;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
int i;
char st;
string s;
void solve() {
    cin >> s;
    set<char> st;
    for (char c : s) {
        st.insert(c);
    }
    bool flag = 0;
    for (char i = 'z'; i >= 'a'; i--) {
        if (flag) {
            if (s.size() == 0) {
                cout << "NO" << '\n';
                return;
            }
            if (s.front() != i && s.back() != i) {
                cout << "NO" << '\n';
                return;
            }
            else {
                if (s.front() == i) {
                    s.erase(0, 1);
                }
                else s.pop_back();
            }
        }
        else {
            if (st.count(i)) {
                flag = true;
                if (s.front() != i && s.back() != i) {
                    cout << "NO" << '\n';
                    return;
                }
                if (s.front() == i) {
                    s.erase(0, 1);
                }
                else s.pop_back();
            }
        }
    }
    if (s.size()) {
        cout << "NO" << '\n';
        return;
    }
    cout << "YES" << '\n';
}

int32_t main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 //   freopen("input.txt", "r", stdin);
 //   freopen("output.txt", "w", stdout);
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}