import java.util.*;
public class uva10340 {
public static void main(String [] args) {
Scanner scn = new Scanner(System.in);
while(scn.hasNext()) {
String s = scn.next();
String t = scn.next();
int b=0,c=0,y;
for(int x=0;x<s.length();x++) {
char a = s.charAt(x);
for(y=b;y<t.length();y++) {
if(a == t.charAt(y)) {
c++;
break;
}
}
b=y+1;
}
if(c == s.length())
System.out.println("Yes");
else
System.out.println("No");
}
}
}
2 comments
commentswrong in ab bbbaaabbb
Replywhy it is wrong? can you clarify it?
Reply