Setting

You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how the strings are generated and inserted into the original message. To validate your method, however, it is necessary to write a program that checks if the message is really encoded in the finnal string. Given two strings s and t, you have to decide whether s is a subsequence of t, i.e. if you can remove characters from t such that the concatenation of the remaining characters is s.

Input

The input contains several testcases. Each is specified by two strings s, t of alphanumeric ASCII characters separated by whitespace. Input is terminated by EOF.

Output

For each test case output, if s is a subsequence of t.

Sample Input

sequence subsequence
person compression
VERDI vivaVittorioEmanueleReDiItalia
caseDoesMatter CaseDoesMatter

Sample Output

Yes
No
Yes
No

This challenge is provided by the ACM International Collegiate Programming Contest.

Upload Solution

Please log in to submit your solution.

Statistics

Difficulty (7 votes)
Average test runtime 0.24
Points (changes over time) 10
Tried by 23 users
Solved by 22 users

Global ranking

# Name Runtime Points worth
1 ,s/java/NaN/gi 0.12 18
2 Daniel 0.14 15
3 Ali 0.15 14
4 Irfan 0.15 14
5 Pascal 0.15 14
6 JB 0.19 11
7 Justin 0.20 11
8 Marvin 0.20 11
9 Chris Danger 0.20 11
10 Melf 0.20 11
11 Phatti McButterpants 0.23 9
12 Skillbo Boblin 0.24 9
13 Finn-Lasse 0.26 8
14 Sushman 0.26 8
15 Dark 0.27 8
16 Mac 0.28 8
17 Tim 0.30 7
18 Niklas 0.31 7
19 Nis 0.32 7
20 AlexanderP 0.32 7
21 IeM 0.39 6
22 YaAlex 0.41 5