#include <bits/stdc++.h>

#define all(v) ((v).begin()), ((v).end())
#define IOS                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0)
#define nl '\n'

using namespace std;
typedef long long ll;

int main()
{
    IOS;

    int TC;
    cin >> TC;
    while (TC--)
    {
        string s;
        cin >> s;
        int n = s.size();
        int f = max(s[0], s[n - 1]);
        int i = 0, j = n - 1;
        while (i <= j)
        {
            if (s[i] == f)
            {
                f--;
                i++;
            }
            else if (s[j] == f)
            {
                f--;
                j--;
            }
            else
            {
                break;
            }
        }
        cout << (j - i < 0 && f == 'a' - 1 ? "YES" : "NO") << nl;
    }
    return 0;
}