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.io.*;
import java.util.*;
public class tr0 {
	static PrintWriter out;
	static StringBuilder sb;
	static final double EPS = 1e-9;
	static int mod = 1000000007;
	static long inf = (long)1e18;
	static long[] fac;
	static int[] si;
	static ArrayList<Integer> primes;
	static ArrayList<Integer>[]ad;
	static int [] numchilds,snc;
	static boolean []vis;
	static int []preorder,T;
	static int idx;
	static HashMap<Integer,Integer> t;
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n=sc.nextInt();
		while(n-->0) {
			String s=sc.nextLine();
			String t=sc.nextLine();
			ArrayList<sol>ss=new ArrayList<>();
			ArrayList<sol>tt=new ArrayList<>();
			for(int i=0;i<s.length();i++) {
				if(i==s.length()-1) {
					ss.add(new sol(1,s.charAt(i)));
					break;	
				}
				char nul=' ';
				int co=0;
				while(i<s.length()-1 && s.charAt(i)==s.charAt(i+1)) {
					i++;
					co++;
					nul=s.charAt(i);
				}
				if(co!=0) {
					ss.add(new sol(co+1,nul));
				}
				else {
					ss.add(new sol(1,s.charAt(i)));
				}
			}
			for(int i=0;i<t.length();i++) {
				if(i==t.length()-1) {
					tt.add(new sol(1,t.charAt(i)));
					break;	
				}
				char nul=' ';
				int co=0;
				while(i<t.length()-1 && t.charAt(i)==t.charAt(i+1)) {
					i++;
					co++;
					nul=t.charAt(i);
				}
				if(co!=0) {
					tt.add(new sol(co+1,nul));
				}
				else {
					tt.add(new sol(1,t.charAt(i)));
				}
			}
			boolean f=true;
			if(ss.size()!=tt.size()) {
				out.println("NO");
				continue;
			}
			for(int i=0;i<ss.size();i++) {
				if(ss.get(i).c!=tt.get(i).c) {
					f=false;
				}
				if(ss.get(i).times>tt.get(i).times) {
					f=false;
				}
			}
			if(f) {
				out.println("YES");
			}
			else {
				out.println("NO");
			}
		}
		out.flush();
	}
	static class sol {
		int times;
		char c;
		sol(int t,char c){
			times=t;
			this.c=c;
		}
		public String toString() {
			return c+" "+times;
		}
	}
	static int fp(int base,int p) {
		if(p==0)
			return 1;
		if(p%2==0) {
			int j=fp(base,p/2);
			return (j*j)%mod;
		}
		else {
			int j=fp(base,p/2);
			j=(j*j)%mod;
			return (j*base)%mod;
		}
	}
	   static public class SegmentTree {       // 1-based DS, OOP
	        int N;          //the number of elements in the array as a power of 2 (i.e. after padding)
	        int [] array, sTree, lazy;
	        SegmentTree(int [] in)
	        {
	            array = in; N = in.length - 1;
	            sTree = new int[N<<1];       //no. of nodes = 2*N - 1, we add one to cross out index zero
	            lazy = new int[N<<1];
	            build(1,1,N);
	        }
	        void build(int node, int b, int e)  // O(n)
	        {
	            if(b == e) {
	                sTree[node] =array[b];
	            }
	            else
	            {
	                int mid = b + e >> 1;
	                build(node<<1,b,mid);
	                build(node<<1|1,mid+1,e);
	                int []tem=new int [6];
	                sTree[node] = sTree[node<<1]+sTree[node<<1|1];
	               // for(int i=0;i<6;i++)
	                //	tem[i]=sTree[node<<1][i]+sTree[node<<1|1][i];
	                //sTree[node]=tem.clone();
	            }
	        }
	       void update_point(int index, int  val)          // O(log n)
	        {
	            index += N - 1;
	            sTree[index] += val;
	           // for(int i=0;i<6;i++)
	            //	sTree[index][i]+=val[i];
	            while(index>1)
	            {
	                index >>= 1;
	                	 //for(int i=0;i<6;i++)
	                sTree[index]= sTree[index<<1] + sTree[index<<1|1];
	            }
	        }
	        int query(int i, int j)
	        {
	            return query(1,1,N,i,j);
	        }
	        int query(int node, int b, int e, int i, int j)    // O(log n)
	        {
	            if(i>e || j <b)
	                return 0;
	            if(b>= i && e <= j)
	                return sTree[node];
	            int mid = b + e >> 1;
	            int  q1 = query(node<<1,b,mid,i,j);
	            int  q2 = query(node<<1|1,mid+1,e,i,j);
	            return q1+q2;
	        }  
	    }

	static void dfs(int u){
		vis[u]=true;
		int c=0;
		for(int v:ad[u]) {
			if(!vis[v]) 
			{c++;
				dfs(v);
				c+=numchilds[v];
			}
		}
		numchilds[u]=c;
	}

	static void seive() {
		 si=new int [1000001];
		    primes=new ArrayList<>();
		    int N=1000001;
		    si[1]=1;
		    for(int i=2;i<N;i++) {
		    	if(si[i]==0) {
		    		si[i]=i;
		    		primes.add(i);
		    	}
		    	for(int j=0;j<primes.size() && primes.get(j)<=si[i] && (i*primes.get(j))<N;j++)
		    		si[primes.get(j)*i]=primes.get(j);
		    		
		    }
	}
	static class pair implements Comparable<pair> {
		long x;
		long y;

		pair(long x, long y) {
			this.x = x;
			this.y = y;
		}

		public String toString() {
			return x + " " + y;
		}

		public int compareTo(pair o) {
			return (int)((o.x-o.y)-(x-y));
		}
	}

	static long inver(long x) {
		int a = (int) x;
		long e = (mod - 2);
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1) {
				// System.out.println(res*a);
				res = (int) ((1l * res * a) % mod);
			}
			a = (int) ((1l * a * a) % mod);
			e >>= 1;
		}
		// out.println(res+" "+x);
		return res % mod;
	}

	static long fac(int n) {
		if (n == 0)
			return fac[n] = 1;
		if (n == 1)
			return fac[n] = 1;
		long ans = 1;
		for (int i = 1; i <= n; i++)
			fac[i] = ans = (i % mod * ans % mod) % mod;
		return ans % mod;
	}

	static long gcd(long a, long b) {

		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	static class unionfind {
		int[] p;
		int[] size;

		unionfind(int n) {
			p = new int[n];
			size = new int[n];

			for (int i = 0; i < n; i++) {
				p[i] = i;
			}
			Arrays.fill(size, 1);
		}

		int findSet(int v) {
			if (v == p[v])
				return v;
			return p[v] = findSet(p[v]);
		}

		boolean sameSet(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			return false;
		}

		int max() {
			int max = 0;
			for (int i = 0; i < size.length; i++)
				if (size[i] > max)
					max = size[i];
			return max;
		}

		void combine(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return;
			if (size[a] > size[b]) {
				p[b] = a;
				size[a] += size[b];

			} else {
				p[a] = b;
				size[b] += size[a];
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

		public Scanner(String file) throws Exception {
			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 String nextLine() throws IOException {
			return br.readLine();
		}

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}