import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        ArrayList<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        }

        String s = mylist.get(0);
        String t = mylist.get(1);

        // 正規表現パターン指定
        Pattern p1 = Pattern.compile(s + "[a-z]");
        Matcher m1 = p1.matcher(t);
        System.out.println(m1.find() ? "Yes" : "No");

    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.regex.Matcher; Matcher java.util.regex import java.util.regex.Pattern; Pattern java.util.regex public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        ArrayList<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        }

        String s = mylist.get(0);
        String t = mylist.get(1);

        // 正規表現パターン指定
        Pattern p1 = Pattern.compile(s + "[a-z]");
        Matcher m1 = p1.matcher(t);
        System.out.println(m1.find() ? "Yes" : "No");

    }

} Main public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        ArrayList<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        }

        String s = mylist.get(0);
        String t = mylist.get(1);

        // 正規表現パターン指定
        Pattern p1 = Pattern.compile(s + "[a-z]");
        Matcher m1 = p1.matcher(t);
        System.out.println(m1.find() ? "Yes" : "No");

    } main {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        ArrayList<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        }

        String s = mylist.get(0);
        String t = mylist.get(1);

        // 正規表現パターン指定
        Pattern p1 = Pattern.compile(s + "[a-z]");
        Matcher m1 = p1.matcher(t);
        System.out.println(m1.find() ? "Yes" : "No");

    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader reader = new BufferedReader(is); reader new BufferedReader(is) ArrayList<String> mylist = new ArrayList<>(); mylist new ArrayList<>() String strinput = reader.readLine(); strinput reader.readLine() reader.readLine reader while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        } strinput != null strinput null {
            mylist.add(strinput);
            strinput = reader.readLine();
        } mylist.add(strinput) mylist.add mylist strinput strinput = reader.readLine() strinput reader.readLine() reader.readLine reader String s = mylist.get(0); s mylist.get(0) mylist.get mylist 0 String t = mylist.get(1); t mylist.get(1) mylist.get mylist 1 Pattern p1 = Pattern.compile(s + "[a-z]"); p1 Pattern.compile(s + "[a-z]") Pattern.compile Pattern s + "[a-z]" s "[a-z]" Matcher m1 = p1.matcher(t); m1 p1.matcher(t) p1.matcher p1 t System.out.println(m1.find() ? "Yes" : "No") System.out.println System.out System System.out m1.find() ? "Yes" : "No" m1.find() m1.find m1 "Yes" "No" String[] args args public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        ArrayList<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        }

        String s = mylist.get(0);
        String t = mylist.get(1);

        // 正規表現パターン指定
        Pattern p1 = Pattern.compile(s + "[a-z]");
        Matcher m1 = p1.matcher(t);
        System.out.println(m1.find() ? "Yes" : "No");

    }

} public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        ArrayList<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        }

        String s = mylist.get(0);
        String t = mylist.get(1);

        // 正規表現パターン指定
        Pattern p1 = Pattern.compile(s + "[a-z]");
        Matcher m1 = p1.matcher(t);
        System.out.println(m1.find() ? "Yes" : "No");

    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        ArrayList<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {
            mylist.add(strinput);
            strinput = reader.readLine();
        }

        String s = mylist.get(0);
        String t = mylist.get(1);

        // 正規表現パターン指定
        Pattern p1 = Pattern.compile(s + "[a-z]");
        Matcher m1 = p1.matcher(t);
        System.out.println(m1.find() ? "Yes" : "No");

    }

}
