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

//#define int long long

int main() {
#ifdef PDTH
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif //PDTH
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  int T; cin >> T;
  while (T--) {
    string s; cin >> s;
    int n = s.size();
    int cur = -1;
    bool ok = true;
    vector<int> a(27, 0);
    for(int i = 0; i < n; ++i) {
      if (s[i] == 'a') cur = i;
    }
    if (cur == -1) { cout << "NO\n"; continue; }
    a[0] = 1;
    for(int i = cur-1; i >= 0; --i) {
      if (s[i] < s[i+1] || a[s[i]-'a']) ok = false;
      else {
        a[s[i]-'a'] = 1;
      }
    }
    for(int i = cur+1; i < n; ++i) {
      if (s[i] < s[i-1] || a[s[i]-'a']) ok = false;
      else {
        a[s[i]-'a'] = 1;
      }
    }
    for(int i = 1; i < 27; ++i) {
      if (a[i] && !a[i-1]) ok = false;
    }
    cout << (ok ? "YES\n" : "NO\n");
  }
}