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.*;

import java.util.*;
import java.util.Map.Entry;
 
public class Main {
 
	//static int [] arr;
	//static boolean prime[] = new boolean[1000]; 
	//static List<Long> al = new ArrayList<>();
	//static int l;
	//static String s; static StringBuilder sb;
	//static HashSet<L> hs;
	//static HashSet<Long> hs = new HashSet<Long>();
	//static int[] prime;
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int t = sc.nextInt();
        //int t = 1;        
        while (t-->0) {
        boolean flag = false;
        char[] s = sc.next().toCharArray();
        char[] tt= sc.next().toCharArray();
        int i = 0;
        if(String.valueOf(s).contains(String.valueOf(tt))) {
        	out.println("YES");
        	continue;
        }
        for( ; i < s.length ; i++)
        	if(s[i] == tt[0])
        		flag |= solve(s,tt,i+1,1);
        out.println(flag?"YES":"NO");

    }


        
        out.close();
    }
    
//    static int nCr(int n, int r) 
//    { 
//        return fact(n) / (fact(r) * 
//                      fact(n - r)); 
//    } 
      
    // Returns factorial of n 
//    static int fact(int n) 
//    { 
//        int res = 1; 
//        for (int i = 2; i <= n; i++) 
//            res = res * i; 
//        return res; 
//    }
    int gcd(int a, int b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }



//    public static boolean isSorted (int [] arr) {
//    	for(int i = 0 ; i < arr.length -1 ; i++)
//    		if(arr[i]>arr[i+1])
//    			return false;
//    	return true;
//    }
	static boolean solve(char[] s , char[] t , int is , int it) {
		
		if(it==t.length)
			return true;
		for(int i = is ; i <s.length && it<t.length ; i+=2) {
			if(s[i]==t[it]) {
				i++;it++;
			}
		}
		
		return it==t.length;
	}
     
}

        

    

//    static void findsubsequences(String s, String ans){
//    	if (s.length() == 0) {
//    		if(ans!="")
//    			if(ans.length()!=l)
//    			al.add(Long.parseLong(ans));
//    		return;
//	}
//
//		// We add adding 1st character in string
//		findsubsequences(s.substring(1), ans + s.charAt(0));
//		
//		// Not adding first character of the string
//		// because the concept of subsequence either
//		// character will present or not
//		findsubsequences(s.substring(1), ans);
//}
    

    

    
//    static void sieve(int n) 
//    { 
//        // Create a boolean array "prime[0..n]" and initialize 
//        // all entries it as true. A value in prime[i] will 
//        // finally be false if i is Not a prime, else true. 
//        
//        for(int i=0;i<n;i++) 
//            prime[i] = true; 
//          
//        for(int p = 2; p*p <=n; p++) 
//        { 
//            // If prime[p] is not changed, then it is a prime 
//            if(prime[p] == true) 
//            { 
//                // Update all multiples of p 
//                for(int i = p*p; i <= n; i += p) 
//                    prime[i] = false; 
//            } 
//        } 
//    }
 //Print all prime numbers 
//        for(int i = 2; i <= n; i++) 
//        { 
//            if(prime[i] == true) 
//                System.out.print(i + " "); 
//        } 
    

 

    

	class Pair  implements Comparable <Pair>{
		int a ;
		int b ;
		public Pair(int a , int b) {
			this.a = a;
			this.b = b;
		}
		@Override
		public int compareTo(Pair o) {
			// TODO Auto-generated method stub
			return this.a-o.a;
		}
		public String toString() {
			return "( " + this.a + " , " + this.b + " )\n";
		}
		
	}
	

	
	

	
	 class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public int[][] nextInt2DArr(int l, int w) throws IOException {
			int [][] arr = new int[l][w];
			for(int i = 0 ; i < l ; i++)
				for(int j = 0 ; j<w ; j++)
				arr[i][j]= Integer.parseInt(next());
			return arr;
		}

		public Scanner(String file) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
		public int[] nextIntArr(int length) throws IOException {
			int[] arr = new int[length];
			for(int i = 0 ; i < length ; i++)
				arr[i] = Integer.parseInt(next());
			return arr;
		}
		public boolean ready() throws IOException {
			return br.ready();
		}
	 }

	 