#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define vec vector<ll>
#define mk make_pair
#define F first
#define S second
#define mod 1000000007
#define all(cc) (cc).begin(),(cc).end()
#define Tesmik ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
int main(){
    	Tesmik
     ll q; cin>>q;
  //vector< pair <ll,ll> > v(n);

for (ll j=0;j<q;j++)
{  string s; cin>>s;
 ll x = s.size();
 string d =s;
 sort(all(d)); bool g=false;
 for (ll i=0;i<x;i++)
 {
     if(d[i]-'a'==i)g=true;
     else {
        g=false; break;
     }
 }

 ll id=-1;
 if (g)
 {
       for (ll i=0;i<x;i++)
     {
         if(s[i]=='a')id=i;
     }
     if(id==0)
     {
         if(is_sorted(all(s)))cout<<"YES\n";
         else cout<<"No\n";
     }
     else if(id==x-1)
     {
         reverse(all(s));
          if(is_sorted(all(s)))cout<<"YES\n";
         else cout<<"No\n";
     }
     else{
        ll l =id-1,r=id+1; bool k=true;
    for (ll i=1;i<x;i++)
    { bool v=true,b=true;
        if(r<=x-1)
        {
            if(s[r]==d[i])r++;
            else v=false;
        }
        else v=false;

        if(l>=0)
        {
            if(s[l]==d[i])l--;
            else b=false;
        }
        else b=false;

        if(!v and  !b){
            cout<<"No\n"; k= false;break;
        }

    }
    if(k)cout<<"YES\n";
     }

 }
 else cout<<"No\n";

}



}
