import java.util.*;


import java.io.*;

public class Main {
    
    public static String solve(String s1 , String s2){
        if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No";
        return (s2.indexOf(s1) == 0) ? "Yes" : "No";
    }
    

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println(solve(br.readLine().trim(),br.readLine().trim()));
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    
    public static String solve(String s1 , String s2){
        if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No";
        return (s2.indexOf(s1) == 0) ? "Yes" : "No";
    }
    

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println(solve(br.readLine().trim(),br.readLine().trim()));
    }
} Main public static String solve(String s1 , String s2){
        if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No";
        return (s2.indexOf(s1) == 0) ? "Yes" : "No";
    } solve {
        if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No";
        return (s2.indexOf(s1) == 0) ? "Yes" : "No";
    } if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No"; Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0 Math.abs(s1.length() - s2.length()) > 1 Math.abs(s1.length() - s2.length()) Math.abs Math s1.length() - s2.length() s1.length() s1.length s1 s2.length() s2.length s2 1 Math.abs(s1.length() - s2.length())== 0 Math.abs(s1.length() - s2.length()) Math.abs Math s1.length() - s2.length() s1.length() s1.length s1 s2.length() s2.length s2 0 return "No"; "No" return (s2.indexOf(s1) == 0) ? "Yes" : "No"; (s2.indexOf(s1) == 0) ? "Yes" : "No" (s2.indexOf(s1) == 0) s2.indexOf(s1) s2.indexOf s2 s1 0 "Yes" "No" String s1 s1 String s2 s2 public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println(solve(br.readLine().trim(),br.readLine().trim()));
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println(solve(br.readLine().trim(),br.readLine().trim()));
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) System.out.println(solve(br.readLine().trim(),br.readLine().trim())) System.out.println System.out System System.out solve(br.readLine().trim(),br.readLine().trim()) solve br.readLine().trim() br.readLine().trim br.readLine() br.readLine br br.readLine().trim() br.readLine().trim br.readLine() br.readLine br String[] args args public class Main {
    
    public static String solve(String s1 , String s2){
        if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No";
        return (s2.indexOf(s1) == 0) ? "Yes" : "No";
    }
    

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println(solve(br.readLine().trim(),br.readLine().trim()));
    }
} public class Main {
    
    public static String solve(String s1 , String s2){
        if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No";
        return (s2.indexOf(s1) == 0) ? "Yes" : "No";
    }
    

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println(solve(br.readLine().trim(),br.readLine().trim()));
    }
} Main
import java.util.*;


import java.io.*;

public class Main {
    
    public static String solve(String s1 , String s2){
        if(Math.abs(s1.length() - s2.length()) > 1 || Math.abs(s1.length() - s2.length())== 0)
            return "No";
        return (s2.indexOf(s1) == 0) ? "Yes" : "No";
    }
    

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println(solve(br.readLine().trim(),br.readLine().trim()));
    }
}