import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        }
    }
} Main public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        }
    } main {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        }
    } try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        } {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String s = br.readLine(); s br.readLine() br.readLine br String t = br.readLine(); t br.readLine() br.readLine br t = t.substring(0, s.length()) t t.substring(0, s.length()) t.substring t 0 s.length() s.length s PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) pw.println((s.equals(t)) ? "Yes" : "No") pw.println pw (s.equals(t)) ? "Yes" : "No" (s.equals(t)) s.equals s t "Yes" "No" pw.flush() pw.flush pw String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        }
    }
} Main
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            
            String s = br.readLine();
            String t = br.readLine();
            t = t.substring(0, s.length());
            
            PrintWriter pw = new PrintWriter(System.out);
            pw.println((s.equals(t)) ? "Yes" : "No");
            pw.flush();
            
        }
    }
}