[PC001] Encryption

Forty-Two Password Inc. has created a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. You must help them validate their method by creating a program that checks if the original message is really encoded in the final string.

The Problem

Given two strings \(A\) and \(B\), you have to check if \(A\) is a subsequence of \(B\), that is, if you can remove characters from \(B\) such that the concatenation of the remaining characters is \(A\).

Input

The first line contains \(T\), the number of test cases that you will need to process. Each of the following \(T\) lines contains \(A\) and \(B\), two strings of lowercase letters.

Output

For each test case (in the same order as they appear in the input) output a line with "yes" if \(A\) is a subsequence of \(B\) and "no" otherwise.

Constraints

The following limits are guaranteed in all the test cases that will be given to your program:

\(1 \leq T \leq 20\)       Number of test cases
\(1 \leq |A| \leq |B| \leq 100\)       Length of strings A and B

Example Input Example Output
4
sequence subsequence
mordor middleearth
jasp javascript
person compression
yes
no
yes
no


Competitive Programming (CC3032) 2024/2025
DCC/FCUP - University of Porto