//主要是有顺序要求用双指针吧 // import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); String t = sc.next(); int valid = t.length(); for(int i = 0, j = 0; i < s.length() && j < t.length();) { if(s.charAt(i) == t.charAt(j)) { i++; j++; valid--; } else { i++; } } if(valid == 0) { System.out.println("Yes"); } else { System.out.println("No"); } } }