import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        StringBuilder sb=new StringBuilder(s1);
        sb.append(s2.charAt(s2.length()-1));
        if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        StringBuilder sb=new StringBuilder(s1);
        sb.append(s2.charAt(s2.length()-1));
        if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
} Main public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        StringBuilder sb=new StringBuilder(s1);
        sb.append(s2.charAt(s2.length()-1));
        if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    } main {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        StringBuilder sb=new StringBuilder(s1);
        sb.append(s2.charAt(s2.length()-1));
        if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    } Scanner in=new Scanner(System.in); in new Scanner(System.in) String s1=in.nextLine(); s1 in.nextLine() in.nextLine in String s2=in.nextLine(); s2 in.nextLine() in.nextLine in StringBuilder sb=new StringBuilder(s1); sb new StringBuilder(s1) sb.append(s2.charAt(s2.length()-1)) sb.append sb s2.charAt(s2.length()-1) s2.charAt s2 s2.length()-1 s2.length() s2.length s2 1 if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        } s2.contains(sb) s2.contains s2 sb {
            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) {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        StringBuilder sb=new StringBuilder(s1);
        sb.append(s2.charAt(s2.length()-1));
        if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
} public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        StringBuilder sb=new StringBuilder(s1);
        sb.append(s2.charAt(s2.length()-1));
        if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String s1=in.nextLine();
        String s2=in.nextLine();
        StringBuilder sb=new StringBuilder(s1);
        sb.append(s2.charAt(s2.length()-1));
        if(s2.contains(sb)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}