#K81232. Genre Identifier Subsequence Checker

    ID: 35708 Type: Default 1000ms 256MiB

Genre Identifier Subsequence Checker

Genre Identifier Subsequence Checker

You are given (T) test cases. In each test case, you are provided with a book's genre string (G) and an identifier string (I). Your task is to determine whether (I) is a subsequence of (G). A string (s) is called a subsequence of another string (t) if all characters of (s) can be found in (t) in the same order (not necessarily contiguous). Note that an empty identifier is always considered a valid subsequence.

For each test case, output "YES" if (I) is a subsequence of (G), and "NO" otherwise.

inputFormat

The input is given via standard input (stdin). The first line contains an integer (T) representing the number of test cases. Each of the following (T) lines contains one test case with two space-separated strings: the genre string (G) and the identifier string (I). If (I) is empty, the line will contain only (G).

outputFormat

For each test case, print a single line to standard output (stdout) containing "YES" if (I) is a subsequence of (G), and "NO" otherwise.## sample

5
literature lit
biology bio
chemistry chemi
mathematics mat
history hiss
YES

YES YES YES NO

</p>