


import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		String a=scanner.next();
		String b=scanner.next() ;
		int length = Math.min(a.length(), b.length());
	    int pos = 0;
	    while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    }
	   // System.out.println(a.substring(pos));
	    //System.out.println(b.substring(pos));

	    	if(a.substring(pos).length()==0) {
	    		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 scanner=new Scanner(System.in);
		String a=scanner.next();
		String b=scanner.next() ;
		int length = Math.min(a.length(), b.length());
	    int pos = 0;
	    while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    }
	   // System.out.println(a.substring(pos));
	    //System.out.println(b.substring(pos));

	    	if(a.substring(pos).length()==0) {
	    		System.out.println("Yes");
	    	}
	    	else {
	    		System.out.println("No");
	    	}


		}


} Main public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		String a=scanner.next();
		String b=scanner.next() ;
		int length = Math.min(a.length(), b.length());
	    int pos = 0;
	    while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    }
	   // System.out.println(a.substring(pos));
	    //System.out.println(b.substring(pos));

	    	if(a.substring(pos).length()==0) {
	    		System.out.println("Yes");
	    	}
	    	else {
	    		System.out.println("No");
	    	}


		} main {
		Scanner scanner=new Scanner(System.in);
		String a=scanner.next();
		String b=scanner.next() ;
		int length = Math.min(a.length(), b.length());
	    int pos = 0;
	    while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    }
	   // System.out.println(a.substring(pos));
	    //System.out.println(b.substring(pos));

	    	if(a.substring(pos).length()==0) {
	    		System.out.println("Yes");
	    	}
	    	else {
	    		System.out.println("No");
	    	}


		} Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) String a=scanner.next(); a scanner.next() scanner.next scanner String b=scanner.next() ; b scanner.next() scanner.next scanner int length = Math.min(a.length(), b.length()); length Math.min(a.length(), b.length()) Math.min Math a.length() a.length a b.length() b.length b int pos = 0; pos 0 while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    } pos < length pos length {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    } if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        } 0 != (a.charAt(pos) ^ b.charAt(pos)) 0 (a.charAt(pos) ^ b.charAt(pos)) a.charAt(pos) a.charAt a pos b.charAt(pos) b.charAt b pos {
	            break;
	        } break; pos++ pos if(a.substring(pos).length()==0) {
	    		System.out.println("Yes");
	    	}
	    	else {
	    		System.out.println("No");
	    	} a.substring(pos).length()==0 a.substring(pos).length() a.substring(pos).length a.substring(pos) a.substring a pos 0 {
	    		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 scanner=new Scanner(System.in);
		String a=scanner.next();
		String b=scanner.next() ;
		int length = Math.min(a.length(), b.length());
	    int pos = 0;
	    while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    }
	   // System.out.println(a.substring(pos));
	    //System.out.println(b.substring(pos));

	    	if(a.substring(pos).length()==0) {
	    		System.out.println("Yes");
	    	}
	    	else {
	    		System.out.println("No");
	    	}


		}


} public class Main{

	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		String a=scanner.next();
		String b=scanner.next() ;
		int length = Math.min(a.length(), b.length());
	    int pos = 0;
	    while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    }
	   // System.out.println(a.substring(pos));
	    //System.out.println(b.substring(pos));

	    	if(a.substring(pos).length()==0) {
	    		System.out.println("Yes");
	    	}
	    	else {
	    		System.out.println("No");
	    	}


		}


} Main



import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		String a=scanner.next();
		String b=scanner.next() ;
		int length = Math.min(a.length(), b.length());
	    int pos = 0;
	    while (pos < length) {
	        if (0 != (a.charAt(pos) ^ b.charAt(pos))) {
	            break;
	        }
	        pos++;
	    }
	   // System.out.println(a.substring(pos));
	    //System.out.println(b.substring(pos));

	    	if(a.substring(pos).length()==0) {
	    		System.out.println("Yes");
	    	}
	    	else {
	    		System.out.println("No");
	    	}


		}


}
