Methodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more than once (if you press a key on a regular keyboard, it prints exactly one symbol).

For example, as a result of typing the word "hello", the following words could be printed: "hello", "hhhhello", "hheeeellllooo", but the following could not be printed: "hell", "helo", "hhllllooo".

Note, that when you press a key, the corresponding symbol must appear (possibly, more than once). The keyboard is broken in a random manner, it means that pressing the same key you can get the different number of letters in the result.

For each word in the letter, Methodius has guessed what word Polycarp actually wanted to write, but he is not sure about it, so he asks you to help him.

You are given a list of pairs of words. For each pair, determine if the second word could be printed by typing the first one on Polycarp's keyboard.

Input

The first line of the input contains one integer n (1 ≤ n ≤ 10^5) — the number of pairs to check. Further input contains n descriptions of pairs.

The first line of each description contains a single non-empty word s consisting of lowercase Latin letters. The second line of the description contains a single non-empty word t consisting of lowercase Latin letters. The lengths of both strings are not greater than 10^6.

It is guaranteed that the total length of all words s in the input is not greater than 10^6. Also, it is guaranteed that the total length of all words t in the input is not greater than 10^6.

Output

Output n lines. In the i-th line for the i-th pair of words s and t print YES if the word t could be printed by typing the word s. Otherwise, print NO.

Examples

Input


4
hello
hello
hello
helloo
hello
hlllloo
hello
helo


Output


YES
YES
NO
NO


Input


5
aa
bb
codeforces
codeforce
polycarp
poolycarpp
aaaa
aaaab
abcdefghijklmnopqrstuvwxyz
zabcdefghijklmnopqrstuvwxyz


Output


NO
NO
YES
NO
NO
import java.util.*;

import java.io.*;
public class Exam {
	public static long mod = (long) Math.pow(10, 9)+7 ;
	public static InputReader sc = new InputReader(System.in);
	public static PrintWriter pw = new PrintWriter(System.out);
	
	public static int check2(int b4,int b3,int b2,int b1,String a[],String s,int x,int y){
		int m=check(b4,b3,b2,b1,a,s,x,y);
		m+=check(b4,b3,b1,b2,a,s,x,y);
		m+=check(b4,b2,b3,b1,a,s,x,y);
		m+=check(b4,b2,b1,b3,a,s,x,y);
		m+=check(b4,b1,b2,b3,a,s,x,y);
		m+=check(b4,b1,b3,b2,a,s,x,y);
		return m;
	}
	public static int check(int a3,int a2,int a1,int a0,String a[],String s,int x,int y){
		a3--;
		a2--;
		a1--;
		a0--;
		int k=0;
		int n=a.length;
		int m=a[0].length();
		for(int i=0;i<s.length();i++){
			if(s.charAt(i)=='3'){
				x+=getx(a3);
				y+=gety(a3);
			}
			else if(s.charAt(i)=='2'){
				x+=getx(a2);
				y+=gety(a2);
			}
			else if(s.charAt(i)=='1'){
				x+=getx(a1);
				y+=gety(a1);
			}
			else if(s.charAt(i)=='0'){
				x+=getx(a0);
				y+=gety(a0);
			}

			if(x>=0&&x<n&&y>=0&&y<m){
					if(a[x].charAt(y)=='E')
					return 1;
					else if(a[x].charAt(y)=='#')
					return 0;
					else
					continue;
			}
			else
			return 0;
		}
		return 0;
	}
	public static int getx(int a){
		if(a==0)
		return 1;
		else if(a==1)
		return -1;
		else
		return 0;
	}
	public static int gety(int a){
		if(a==2)
		return 1;
		else if(a==3)
		return -1;
		else
		return 0;
	}
	void te(){
		int z=sc.nextInt();
		while(z-->0){
			int n=sc.nextInt();
			String s=sc.nextLine();
			int st[]=new int[s.length()];
			int t=-1;
			st[++t]=s.charAt(0);
			int xor[]=new int[n+1];
			xor[t+1]=s.charAt(0);
			int l=s.charAt(0);
			for(int i=1;i<s.length();i++){
				if(t>=0&&st[t]<s.charAt(i)){
					t--;
				}
				else{
					st[++t]=s.charAt(i);
					xor[t+1]=s.charAt(i)^xor[t];
				}
				l+=xor[t+1];
			}
			pw.println(l);
			
		}
	}
	public static int dp[][]=new int[500+1][500+1];
	static{
		for(int i=0;i<501;i++){
		Arrays.fill(dp[i], -1);
	}
	}
	public static int color(int start,int end,int a[]){
		int min=(int)1e9;
		if(dp[start][end]!=-1){
			return dp[start][end];
		}
		if(start==end){
			dp[start][end]=1;
			return 1;
		}
		if(start+1==end&&a[start]==a[end]){
			dp[start][end]=0;
			return 0;
		}
		min=color(start, end-1, a)+1;
		for(int i=start;i<end;i++){
			if(a[i]==a[end]){
			if(i-1>=start&&i+1<=end-1)
			min=Math.min(color(start,i-1,a)+color(i+1,end-1,a), min);
			else if(i-1>=start)
			min=Math.min(color(start,i-1,a), min);
			else if(i+1<=end-1)
			min=Math.min(color(i+1,end-1,a), min);
			else
			min=0;
			}
		}
		dp[start][end]=min;
		return min;
	}
	public static void main(String[] args) {
		// Code starts..
		int z=sc.nextInt();
		while(z-->0){
			String a=sc.nextLine();
			String b=sc.nextLine();
			int f=0;
			if(a.length()>b.length()){
				f=1;
			}
			int t=0,last=0;
			for(int i=0;i<b.length();i++){
				if(t<a.length()&&a.charAt(t)==b.charAt(i)){
					last=a.charAt(t);
					t++;
				}
				else if(b.charAt(i)!=last){
					f=1;
					break;
				}
			}
			if(t!=a.length())
			f=1;
			if(f==0)
			pw.println("YES");
			else
			pw.println("NO");
			
		}
		// Code ends...
		pw.flush();
		pw.close();
	}


	
	public static void shortestPathDfs(int a[][]){
		StringBuilder out = new StringBuilder();
		int n=a.length-1;
		int st[]=new int[n+1];
		int t=0;
		st[t]=1;
		int w=0;
		int vi[]=new int[n+1];
		Arrays.fill(vi, 1);
		int vis[]=new int[n+1];
		vis[1]=1;
		ArrayList<Integer> r=new ArrayList<>();
		int minw=(int)1e9;
		while(t!=-1){
			int f=0;
			for(int i=vi[st[t]];i<=n;i++){
				if(a[st[t]][i]!=0&&vis[i]==0){
					w+=a[st[t]][i];
					vi[st[t]]=i+1;
					st[++t]=i;
					f=1;
					vis[i]=1;
					if(st[t]==n){
						f=0;
						if(w<minw){
							minw=w;
							r=new ArrayList<>();
							for(int j=0;j<=t;j++){
								r.add(st[j]);
							}
						}
					}
					break;
				}
			}
			if(f==0){
				vis[st[t]]=0;
				vi[st[t]]=1;
				if(t>0)
				w=w-a[st[t-1]][st[t]];
				t--;
			}
		}
		if(r.size()!=0)
		for(int i=0;i<r.size();i++){
			out.append(r.get(i)+" ");
		}
		else
		out.append("-1");
		pw.println(out);
	}



	public static String reverseString(String s){
		StringBuilder input1 = new StringBuilder(); 
        input1.append(s);  
		input1 = input1.reverse();
		return input1.toString();
	}
	public static int[] scanArray(int n){
		int a[]=new int [n];
		for(int i=0;i<n;i++)
		a[i]=sc.nextInt();
 
		return a;
	}
	public static long[] scanLongArray(int n){
		long a[]=new long [n];
		for(int i=0;i<n;i++)
		a[i]=sc.nextLong();
 
		return a;
	}
	public static String [] scanStrings(int n){
		String a[]=new String [n];
		for(int i=0;i<n;i++)
		a[i]=sc.nextLine();
 
		return a;
	}
	static class InputReader {
 
		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}
 
		public String readString() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public String nextLine() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isEndOfLine(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
 
}