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.
//package currentContest;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class P4 {
	static int N = 1000001;

	// Array to store inverse of 1 to N
	static long[] factorialNumInverse = new long[N + 1];

	// Array to precompute inverse of 1! to N!
	static long[] naturalNumInverse = new long[N + 1];

	// Array to store factorial of first N numbers
	static long[] fact = new long[N + 1];

	// Function to precompute inverse of numbers
	public static void InverseofNumber(int p) {
		naturalNumInverse[0] = naturalNumInverse[1] = 1;

		for (int i = 2; i <= N; i++)
			naturalNumInverse[i] = naturalNumInverse[p % i] * (long) (p - p / i) % p;
	}

	// Function to precompute inverse of factorials
	public static void InverseofFactorial(int p) {
		factorialNumInverse[0] = factorialNumInverse[1] = 1;

		// Precompute inverse of natural numbers
		for (int i = 2; i <= N; i++)
			factorialNumInverse[i] = (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p;
	}

	// Function to calculate factorial of 1 to N
	public static void factorial(int p) {
		fact[0] = 1;

		// Precompute factorials
		for (int i = 1; i <= N; i++) {
			fact[i] = (fact[i - 1] * (long) i) % p;
		}
	}

	// Function to return nCr % p in O(1) time
	public static long Binomial(int N, int R, int p) {

		// n C r = n!*inverse(r!)*inverse((n-r)!)
		long ans = ((fact[N] * factorialNumInverse[R]) % p * factorialNumInverse[N - R]) % p;

		return ans;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int t;
		t = sc.nextInt();
		StringBuilder st = new StringBuilder();
//		int p = 998244353;
//	    InverseofNumber(p);
//	    InverseofFactorial(p);
//	    factorial(p);
		// System.out.println(3|1);
		while (t-- != 0) {
			String a=sc.nextLine();
			String b=sc.nextLine();
			StringBuilder ese=new StringBuilder();
			int ap=a.length()-1;
			int bp=b.length()-1;
			while(ap>=0&&bp>=0) {
				if(a.charAt(ap)==b.charAt(bp)) {
					ese.append(a.charAt(ap));
					ap--;
					bp--;
				}else {
					ap=ap-2;
				}
			}
			if(ese.length()==b.length()) {
				st.append("YES\n");
			}else {
				st.append("NO\n");
			}
		}
		System.out.println(st);
	}

	static FastReader sc = new FastReader();

	public static void solvegraph() {
		int n = sc.nextInt();

		int edge[][] = new int[n - 1][2];
		for (int i = 0; i < n - 1; i++) {
			edge[i][0] = sc.nextInt() - 1;
			edge[i][1] = sc.nextInt() - 1;
		}
		ArrayList<ArrayList<Integer>> ad = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			ad.add(new ArrayList<Integer>());
		}
		for (int i = 0; i < n - 1; i++) {
			ad.get(edge[i][0]).add(edge[i][1]);
			ad.get(edge[i][1]).add(edge[i][0]);
		}
		int parent[] = new int[n];
		Arrays.fill(parent, -1);
		parent[0] = n;
		ArrayDeque<Integer> queue = new ArrayDeque<>();
		queue.add(0);
		int child[] = new int[n];
		Arrays.fill(child, 0);
		ArrayList<Integer> lv = new ArrayList<Integer>();
		while (!queue.isEmpty()) {
			int toget = queue.getFirst();
			queue.removeFirst();
			child[toget] = ad.get(toget).size() - 1;
			for (int i = 0; i < ad.get(toget).size(); i++) {
				if (parent[ad.get(toget).get(i)] == -1) {
					parent[ad.get(toget).get(i)] = toget;
					queue.addLast(ad.get(toget).get(i));
				}
			}
			lv.add(toget);
		}

		child[0]++;
	}

	static void sort(int[] A) {
		int n = A.length;
		Random rnd = new Random();
		for (int i = 0; i < n; ++i) {
			int tmp = A[i];
			int randomPos = i + rnd.nextInt(n - i);
			A[i] = A[randomPos];
			A[randomPos] = tmp;
		}
		Arrays.sort(A);
	}

	static void sort(long[] A) {
		int n = A.length;
		Random rnd = new Random();
		for (int i = 0; i < n; ++i) {
			long tmp = A[i];
			int randomPos = i + rnd.nextInt(n - i);
			A[i] = A[randomPos];
			A[randomPos] = tmp;
		}
		Arrays.sort(A);
	}

	static String sort(String s) {
		Character ch[] = new Character[s.length()];
		for (int i = 0; i < s.length(); i++) {
			ch[i] = s.charAt(i);
		}
		Arrays.sort(ch);
		StringBuffer st = new StringBuffer("");
		for (int i = 0; i < s.length(); i++) {
			st.append(ch[i]);
		}
		return st.toString();
	}

	public static long gcd(long a, long b) {
		if (a == 0) {
			return b;
		}
		return gcd(b % a, a);
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

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

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

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

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}
