You are given two strings s and t, both consisting of lowercase English letters. You are going to type the string s character by character, from the first character to the last one.

When typing a character, instead of pressing the button corresponding to it, you can press the "Backspace" button. It deletes the last character you have typed among those that aren't deleted yet (or does nothing if there are no characters in the current string). For example, if s is "abcbd" and you press Backspace instead of typing the first and the fourth characters, you will get the string "bd" (the first press of Backspace deletes no character, and the second press deletes the character 'c'). Another example, if s is "abcaa" and you press Backspace instead of the last two letters, then the resulting text is "a".

Your task is to determine whether you can obtain the string t, if you type the string s and press "Backspace" instead of typing several (maybe zero) characters of s.

Input

The first line contains a single integer q (1 ≤ q ≤ 10^5) — the number of test cases.

The first line of each test case contains the string s (1 ≤ |s| ≤ 10^5). Each character of s is a lowercase English letter.

The second line of each test case contains the string t (1 ≤ |t| ≤ 10^5). Each character of t is a lowercase English letter.

It is guaranteed that the total number of characters in the strings over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case, print "YES" if you can obtain the string t by typing the string s and replacing some characters with presses of "Backspace" button, or "NO" if you cannot.

You may print each letter in any case (YES, yes, Yes will all be recognized as positive answer, NO, no and nO will all be recognized as negative answer).

Example

Input


4
ababa
ba
ababa
bb
aaa
aaaa
aababa
ababa


Output


YES
NO
NO
YES

Note

Consider the example test from the statement.

In order to obtain "ba" from "ababa", you may press Backspace instead of typing the first and the fourth characters.

There's no way to obtain "bb" while typing "ababa".

There's no way to obtain "aaaa" while typing "aaa".

In order to obtain "ababa" while typing "aababa", you have to press Backspace instead of typing the first character, then type all the remaining characters.

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
        //import java.util.*;
    public class Solution {

        static class FastScanner {

                BufferedReader br;
                StringTokenizer st ;

                FastScanner(){
                    br =  new BufferedReader(new InputStreamReader(System.in));
                    st = new StringTokenizer("");
                }

                FastScanner(String file) {

                    try {
                        br =  new BufferedReader(new InputStreamReader(new FileInputStream(file)));
                        st = new StringTokenizer("");
                    } catch (FileNotFoundException e) {
                        // TODO Auto-generated catch block
                        System.out.println("file not found");
                        e.printStackTrace();
                    }
                    
                }
                

                String next() {
                    while (!st.hasMoreTokens())
                        try {
                            st = new StringTokenizer(br.readLine());
                        } catch (IOException e) {
                        }
                    return st.nextToken();
                }

                int nextInt() {
                    return Integer.parseInt(next());
                }

                long nextLong() {
                    return Long.parseLong(next());
                }
                String readLine() throws IOException{
                    return br.readLine();
                }
            }
                                  
        static class Pair{
            String word;
            int cnt;
            Pair(String word,int cnt){
                this.word = word;
                this.cnt = cnt;
            }

        }

        

     public static void main(String[] args) throws Exception {
        
        FastScanner s = new FastScanner();

        //Scanner s = new Scanner(System.in);

        int t = s.nextInt();

        for(int tc=0;tc<t;tc++){

            String str = s.next();
            String tr = s.next();

            char s1[] = str.toCharArray();
            char s2[] = tr.toCharArray();

            int i1 = s1.length - 1;
            int i2 = s2.length - 1;
            
            while(i2>=0){
                if(s1[i1] == s2[i2]){
                    i1--;
                    i2--;
                }else{
                    i1-=2;
                }
                if(i1<0){break;}
            }

            if(i2 == -1){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        
        }
    }

  

    public static List<Integer> sieve(){
       
        List<Integer> prime = new ArrayList<>();

        int arr[] = new int[100001];

        Arrays.fill(arr,1);

        arr[1] = 0;
        arr[2] = 1;

        for(int i=2;i<=100000;i++){
            
            if(arr[i] == 1){
                
                prime.add(i);

                for(long j = (i*1l*i);j<100001;j+=i){
                    arr[(int)j] = 0;
                }
            }
        }

        return prime;
    }

    static boolean isPower(long n,long a){
        
        long log = (long)(Math.log(n)/Math.log(a));

        long power = (long)Math.pow(a,log);

        if(power == n){return true;}

        return false;
    }


    private static int mergeAndCount(int[] arr, int l,int m, int r)
    {

        // Left subarray
        int[] left = Arrays.copyOfRange(arr, l, m + 1);

        // Right subarray
        int[] right = Arrays.copyOfRange(arr, m + 1, r + 1);

        int i = 0, j = 0, k = l, swaps = 0;

        while (i < left.length && j < right.length) {
            if (left[i] <= right[j])
                arr[k++] = left[i++];
            else {
                arr[k++] = right[j++];
                swaps += (m + 1) - (l + i);
            }
        }
        while (i < left.length)
            arr[k++] = left[i++];
        while (j < right.length)
            arr[k++] = right[j++];
        return swaps;
    }

    // Merge sort function
    private static int mergeSortAndCount(int[] arr, int l,int r)
    {

        // Keeps track of the inversion count at a
        // particular node of the recursion tree
        int count = 0;

        if (l < r) {
            int m = (l + r) / 2;

            // Total inversion count = left subarray count
            // + right subarray count + merge count

            // Left subarray count
            count += mergeSortAndCount(arr, l, m);

            // Right subarray count
            count += mergeSortAndCount(arr, m + 1, r);

            // Merge count
            count += mergeAndCount(arr, l, m, r);
        }

        return count;
    }

}
