// Arup Guha
// 3/25/2013
// Solution to 2016 COP 4516 Individual Week #1 Contest Problem: Upwards

import java.util.*;

public class upwards {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Go through each case and output 5 times the input.
		for (int loop=0; loop<numCases; loop++) {
			String word = stdin.next();
			System.out.println(isUpWards(word));
		}
	}

	// Returns "YES" if word is an Up Word, and "NO" otherwise.
	public static String isUpWards(String word) {

		// Look for two consecutive letters that aren't "up wards".
		for (int i=0; i<word.length()-1; i++)
			if (word.charAt(i) >= word.charAt(i+1))
				return "NO";

		// If we get here, we pass!
		return "YES";
	}
}