#include<bits/stdc++.h>
using namespace std;
typedef long long ll;


int main()
{
    ll i,j,k,l,m,n,r;
    ll xa,xb,xf;
    ll ya,yb,yf;
    int t;
    cin >> t;

    while(t--)
    {
        string s;
        cin >> s;

        n = s.size();
        l=r=-1;
        set<char>st;
        for(i=0;i<n;i++)
        {
            st.insert(s[i]);
            if(s[i]=='a')l=r=i;
        }
        if(st.size()!=n||l==-1)
        {
            cout << "NO" << endl;continue;
        }
        bool ok = true;
        for(i=1;i<n;i++)
        {
            if(l-1>=0&&s[l-1]==char('a'+i))l--;
            else if(r+1<n&&s[r+1]==char('a'+i))r++;
            else ok=false;
        }

        if(ok)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
}
