description: 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.
solution: /*
   
      /$$$$$  /$$$$$$  /$$    /$$  /$$$$$$                                                                  
     |__  $$ /$$__  $$ |$$    |$$ /$$__  $$                                                                 
            | $$| $$  \ $$|    $$|$$| $$  \ $$                                                                 
            | $$| $$$$$$$$|  $$ / $$/| $$$$$$$$                                                                 
  / $$  | $$| $$__  $$ \  $$ $$/ | $$__  $$                                                                 
  | $$  | $$| $$  | $$  \  $$$/  | $$  | $$                                                                 
  |  $$$$$$/| $$  | $$   \  $/   | $$  | $$                                                                 
   \______/ |__/  |__/    \_/    |__/  |__/    
   
  /$$$$$$$  /$$$$$$$   /$$$$$$   /$$$$$$  /$$$$$$$   /$$$$$$  /$$      /$$ /$$      /$$ /$$$$$$$$ /$$$$$$$ 
  | $$__  $$| $$__  $$ /$$__  $$ /$$__  $$| $$__  $$ /$$__  $$| $$$    /$$$| $$$    /$$$| $$_____/| $$__  $$
  | $$  \ $$| $$  \ $$| $$  \ $$| $$  \__/| $$  \ $$| $$  \ $$| $$$$  /$$$$| $$$$  /$$$$| $$      | $$  \ $$
  | $$$$$$$/| $$$$$$$/| $$  | $$| $$ /$$$$| $$$$$$$/| $$$$$$$$| $$ $$/$$ $$| $$ $$/$$ $$| $$$$$   | $$$$$$$/
  | $$____/ | $$__  $$| $$  | $$| $$|_  $$| $$__  $$| $$__  $$| $$  $$$| $$| $$  $$$| $$| $$__/   | $$__  $$
  | $$      | $$  \ $$| $$  | $$| $$  \ $$| $$  \ $$| $$  | $$| $$\  $ | $$| $$\  $ | $$| $$      | $$  \ $$
  | $$      | $$  | $$|  $$$$$$/|  $$$$$$/| $$  | $$| $$  | $$| $$ \/  | $$| $$ \/  | $$| $$$$$$$$| $$  | $$
  |__/      |__/  |__/ \______/  \______/ |__/  |__/|__/  |__/|__/     |__/|__/     |__/|________/|__/  |__/
                                                                                                             
                                                                                                                                                                                                                   
                                                                                                                                                                                                                  
   
  */
  ////solution at bottom 
  import java.util.*;
  import java.lang.*;
  import java.io.*;
  import java.math.*;
  
   
  /* Name of the class has to be "Main" only if the class is public. */
           public class test
  {
      static void shuffle( int arr[])
      {
          int n = arr.length;
          Random r = new Random();
           
         for (int i = n-1; i > 0; i--) {
             int j = r.nextInt(i+1);
               
              int temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
          }
      }
      static void shuffle( long arr[])
      {
          int n = arr.length;
          Random r = new Random();
           
         for (int i = n-1; i > 0; i--) {
             int j = r.nextInt(i+1);
               
              long temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
          }
      }
      static void shuffle( int arr[][])
      {
          int n = arr.length;
          Random r = new Random();
           
         for (int i = n-1; i > 0; i--) {
             int j = r.nextInt(i+1);
               
              int[] temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
          }
      }
      
      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[][] tdiarr(int m , int n){
              int[][] a = new int[m][n];
              for(int i=0;i<m;i++){
                  for(int j=0;j<n;j++){
                      a[i][j]=Integer.parseInt(next());
                  }
              }
              return a;
          }
          long[][] tdlarr(int m , int n){
              long[][] a = new long[m][n];
              for(int i=0;i<m;i++){
                  for(int j=0;j<n;j++){
                      a[i][j]=Long.parseLong(next());
                  }
              }
              return a;
          }
   
          int[] niarr(int n)
          {
              int[] a = new int[n];
              for(int i=0;i<n;i++)a[i]=Integer.parseInt(next());
              return a;
          }
          long[] nlarr(int n)
          {
              long[] a = new long[n];
              for(int i=0;i<n;i++)a[i]=Long.parseLong(next());
              return a;
          }
          char[] ncarr(){
              return next().trim().toCharArray();
              
              
          }
          
    
          int ni() 
          { 
              return Integer.parseInt(next()); 
          } 
    
          long nl() 
          { 
              return Long.parseLong(next()); 
          } 
    
          double nd() 
          { 
              return Double.parseDouble(next()); 
          } 
    
          String nstr() 
          { 
              String str = ""; 
              try
              { 
                  str = br.readLine(); 
              } 
              catch (IOException e) 
              { 
                  e.printStackTrace(); 
              } 
              return str; 
          } 
      }
      
       
      static boolean checkbound(int x , int y , int m , int n){
          if(x<0 || x>=m || y<0 || y>=n)return false;
          return true;
      }
      static void printarr(int[][] a){
          int m = a.length , n = a[0].length;
          for(int i=0;i<m;i++){
              for(int j=0;j<n;j++){
                  System.out.print(a[i][j]+" ");
              }
              System.out.println();
          }
      }
      static void printarr(char[][] a){
          int m = a.length , n = a[0].length;
          for(int i=0;i<m;i++){
              for(int j=0;j<n;j++){
                  System.out.print(a[i][j]+" ");
              }
              System.out.println();
          }
      }
      static void printarr(int[] a){
          int n = a.length;
          StringBuilder sb = new StringBuilder();
              for(int j=0;j<n;j++){
                  sb.append(a[j]+" "); 
              }
              System.out.println(sb);
   
          
      }
      static void printarr(long[] a){
          int n = a.length;
          StringBuilder sb = new StringBuilder();
              for(int j=0;j<n;j++){
                  sb.append(a[j]+" "); 
              }
              System.out.println(sb);
   
          
      }
   
      static void revarr(int[] a ){
          int i=0,j=a.length-1;
          while(i<j){
              int tem = a[i];
              a[i]=a[j];
              a[j]=tem;
              i++;j--;
          }
           
      }
     
      
   
       static boolean[] sieveOfEratosthenes(int n)
      {
           
          boolean prime[] = new boolean[n + 1];
          for (int i = 0; i <= n; i++)
              prime[i] = true;
   
          for (int p = 2; p * p <= n; p++)
          {
               if (prime[p] == true)
              {
                   for (int i = p * p; i <= n; i += p)
                      prime[i] = false;
              }
          }
          prime[1]=false;
   
          return prime;
      }
   
      static int gcd(int a, int b)
      {
          if (a == 0)
              return b;
           
          return gcd(b%a, a);
      }
   
      static int lcm(int a, int b)
      {
          return (a / gcd(a, b)) * b;
      }
   
      static long gcd(long a, long b)
      {
          if (a == 0L)
              return b;
           
          return gcd(b%a, a);
      }
   
      static long lcm(long a, long b)
      {
          return (a / gcd(a, b)) * b;
      }
   
      public static class Pair{
          int x;
          int y;
   
          public Pair(int x, int y){
              this.x = x;
              this.y = y;
          }
   
           
      }
      
      static int[] st;
      static FastReader br=new FastReader();
  /*
   
  */
  ///////////////////////////////////////////////////////////
   
   
   
   
   
      public static void main (String[] args) throws java.lang.Exception
      {
          // your code goes here
           
          int t=1;
          br=new FastReader();
                                    t=br.ni();
  
          
    
       in1 :   for(int TC = 1; TC <= t ; TC++)
          {
              
                  solve();
   
   
       
          }
            
              //          System.out.println("OUTPUT:::");
      
            System.out.println(sb);
      }
      ///end main
      static StringBuilder sb = new StringBuilder();
      
      static void solve() throws Exception{
                        char[] a = br.ncarr();
                        char[] b = br.ncarr();
                        int n = a.length , m = b.length;
                        int i = n-1 , j = m-1;
                        while(i>=0 && j>=0 && a[i] != b[j]){
                          i -= 2;
  
                        }
                        if(i<0){
                          sb.append("NO\n");
                          return;
                        }
                        j--;i--;
                        while(i>=0 && j>=0){
                           int l = i;
                           while(i>=0 && a[i] != b[j]){
                              i-=2;
  
                           }
                           if(i<0){
                              sb.append("NO\n");
                              return;
                           }
                           i--;
                           j--;
  
  
                        }
                        if(j == -1)sb.append("YES\n");
                        else sb.append("NO\n");
                        
             }
                  
      //end solve
  
              
   
      }
      //end class  
   
      /* stuff you should look for
      * int overflow, array bounds
      * special cases (n=1?)
      * do smth instead of nothing and stay organized
      * WRITE STUFF DOWN
      * DON'T GET STUCK ON ONE APPROACH
    
   TC:
     
   
   
        */          
             
  