import java.util.Scanner;
public class Main {
	static int[][] gyo2=new int[100000][12];
	static int count=0;
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		String[] s=S.split("");
		String[] t=T.split("");
		for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");

}

} import java.util.Scanner; Scanner java.util public class Main {
	static int[][] gyo2=new int[100000][12];
	static int count=0;
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		String[] s=S.split("");
		String[] t=T.split("");
		for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");

}

} Main static int[][] gyo2=new int[100000][12]; gyo2 new int[100000][12] 100000 12 static int count=0; count 0 @SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		String[] s=S.split("");
		String[] t=T.split("");
		for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");

} main {
		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		String[] s=S.split("");
		String[] t=T.split("");
		for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");

} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String S=sc.next(); S sc.next() sc.next sc String T=sc.next(); T sc.next() sc.next sc String[] s=S.split(""); s S.split("") S.split S "" String[] t=T.split(""); t T.split("") T.split T "" for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		} int i=0; int i=0; i 0 i<s.length i s.length s s.length i++ i++ i {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		} {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		} if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			} !s[i].equals(t[i]) s[i].equals(t[i]) s[i].equals s[i] s i t[i] t i {
				System.out.println("No");
				System.exit(0);
			} System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {
	static int[][] gyo2=new int[100000][12];
	static int count=0;
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		String[] s=S.split("");
		String[] t=T.split("");
		for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");

}

} public class Main {
	static int[][] gyo2=new int[100000][12];
	static int count=0;
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		String[] s=S.split("");
		String[] t=T.split("");
		for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");

}

} Main
import java.util.Scanner;
public class Main {
	static int[][] gyo2=new int[100000][12];
	static int count=0;
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		String[] s=S.split("");
		String[] t=T.split("");
		for(int i=0;i<s.length;i++) {
			if(!s[i].equals(t[i])) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");

}

}
