405890: GYM102152 H The Universal String
Description
Have you ever heard about the universal string? This is the largest string in the world, and it is the mother of all strings that will ever exist in any programming language!
The universal string is an infinite string built by repeating the string "abcdefghijklmnopqrstuvwxyz" infinitely. So, the universal string will look like this:
You are given a string $$$p$$$ and your task is to determine if $$$p$$$ is a substring of the universal string. Can you?
A substring of $$$s$$$ is a non-empty string $$$x$$$ = $$$s$$$[$$$l$$$$$$\dots$$$ $$$r$$$] = $$$s_l$$$$$$s_{l+1}$$$$$$\dots$$$ $$$s_r$$$ (1 $$$\le$$$ $$$l$$$ $$$\le$$$ $$$r$$$ $$$\le$$$ |$$$s$$$|). For example, "code" and "force" are substring of "codeforces", while "coders" is not.
InputThe first line contains an integer $$$T$$$ ($$$1 \le T \le 10^3$$$) specifying the number of test cases.
Each test consists of a single line containing a non-empty string $$$p$$$ of length no more $$$10^3$$$ and consisting only of lowercase English letters.
OutputFor each test case, print "YES" (without quotes) if the given string is a substring of the universal string. Otherwise, print "NO" (without quotes).
ExampleInput3 abcde abd wxyzabcOutput
YES NO YES