#include <bits/stdc++.h>
#define ll long long
#define EL "\n"
using namespace std;

int Count[50];
string Solve(string s) {
    for (int i = 0; i < 30; i++) Count[i] = 0;
    int P = 0, pos = 0;
    for (int i = 0; i < s.size(); i++) {
        Count[s[i] - 'a']++;
        P = max(P, (int) s[i] - 'a');
        if (s[i] == 'a') pos = i;
    }

    for (int i = 0; i <= P; i++) {
        if (Count[i] != 1) return "NO\n";
    }

    for (int i = 0; i < pos - 1; i++) {
        int x = s[i], y = s[i + 1];
        if (x <= y) return "NO\n";
    }
    for (int i = pos + 1; i < s.size() - 1; i++) {
        int x = s[i], y = s[i + 1];
        if (x >= y) return "NO\n";
    }
    return "YES\n";
}
void Input() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int T; cin >> T;
    while (T--) {
        string s; cin >> s;
        cout << Solve(s);
    }
}

int main() {
    Input();
}
