import java.util.Scanner;
public class Main {
		 
		static void solve() {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			String T = sc.next();
			int res = 0;
			sc.close();
			for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			}	
			if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		}
	}
	public static void main(String[] args) {
		solve();
	}

} import java.util.Scanner; Scanner java.util public class Main {
		 
		static void solve() {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			String T = sc.next();
			int res = 0;
			sc.close();
			for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			}	
			if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		}
	}
	public static void main(String[] args) {
		solve();
	}

} Main static void solve() {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			String T = sc.next();
			int res = 0;
			sc.close();
			for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			}	
			if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		}
	} solve {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			String T = sc.next();
			int res = 0;
			sc.close();
			for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			}	
			if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		}
	} 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 int res = 0; res 0 sc.close() sc.close sc for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			} int  i = 0; int  i = 0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			} {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			} if(S.charAt(i)==T.charAt(i)) {
					res++;
				} S.charAt(i)==T.charAt(i) S.charAt(i) S.charAt S i T.charAt(i) T.charAt T i {
					res++;
				} res++ res if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		} res +1>=T.length() res +1 res 1 T.length() T.length T {
				System.out.print("Yes");
			} System.out.print("Yes") System.out.print System.out System System.out "Yes" {
				System.out.print("No");
		} System.out.print("No") System.out.print System.out System System.out "No" public static void main(String[] args) {
		solve();
	} main {
		solve();
	} solve() solve String[] args args public class Main {
		 
		static void solve() {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			String T = sc.next();
			int res = 0;
			sc.close();
			for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			}	
			if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		}
	}
	public static void main(String[] args) {
		solve();
	}

} public class Main {
		 
		static void solve() {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			String T = sc.next();
			int res = 0;
			sc.close();
			for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			}	
			if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		}
	}
	public static void main(String[] args) {
		solve();
	}

} Main
import java.util.Scanner;
public class Main {
		 
		static void solve() {
			Scanner sc = new Scanner(System.in);
			String S = sc.next();
			String T = sc.next();
			int res = 0;
			sc.close();
			for(int  i = 0; i<S.length();i++) {
				if(S.charAt(i)==T.charAt(i)) {
					res++;
				}
			}	
			if(res +1>=T.length()) {
				System.out.print("Yes");
			}
			else {
				System.out.print("No");
		}
	}
	public static void main(String[] args) {
		solve();
	}

}
