import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        }
    } try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        } {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String T = sc.next(); T sc.next() sc.next sc System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No") System.out.println System.out System System.out T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No" T.substring(0, T.length() - 1).equals(S) T.substring(0, T.length() - 1).equals T.substring(0, T.length() - 1) T.substring T 0 T.length() - 1 T.length() T.length T 1 S "Yes" "No" String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();
            System.out.println(T.substring(0, T.length() - 1).equals(S) ? "Yes" : "No");
        }
    }
}
