import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s1=br.readLine().trim();
        String s2=br.readLine().trim();
        int n=s2.length()-1;
        String s3=s2.substring(0,n);

        if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }




    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s1=br.readLine().trim();
        String s2=br.readLine().trim();
        int n=s2.length()-1;
        String s3=s2.substring(0,n);

        if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }




    }

} Main public static void main(String[] args) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s1=br.readLine().trim();
        String s2=br.readLine().trim();
        int n=s2.length()-1;
        String s3=s2.substring(0,n);

        if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }




    } main {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s1=br.readLine().trim();
        String s2=br.readLine().trim();
        int n=s2.length()-1;
        String s3=s2.substring(0,n);

        if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }




    } BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s1=br.readLine().trim(); s1 br.readLine().trim() br.readLine().trim br.readLine() br.readLine br String s2=br.readLine().trim(); s2 br.readLine().trim() br.readLine().trim br.readLine() br.readLine br int n=s2.length()-1; n s2.length()-1 s2.length() s2.length s2 1 String s3=s2.substring(0,n); s3 s2.substring(0,n) s2.substring s2 0 n if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        } s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1) s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1) s3.equals(s1) s3.equals s3 s1 !s1.equals(s2) s1.equals(s2) s1.equals s1 s2 (s2.length()==s1.length()+1) s2.length() s2.length s2 s1.length()+1 s1.length() s1.length s1 1 {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {

    public static void main(String[] args) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s1=br.readLine().trim();
        String s2=br.readLine().trim();
        int n=s2.length()-1;
        String s3=s2.substring(0,n);

        if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }




    }

} public class Main {

    public static void main(String[] args) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s1=br.readLine().trim();
        String s2=br.readLine().trim();
        int n=s2.length()-1;
        String s3=s2.substring(0,n);

        if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }




    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s1=br.readLine().trim();
        String s2=br.readLine().trim();
        int n=s2.length()-1;
        String s3=s2.substring(0,n);

        if(s3.equals(s1) && !s1.equals(s2) && (s2.length()==s1.length()+1))
        {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }




    }

}
