printРабочее место участника

printЗадачи

1722. Encoding

Ограничения: время – 200ms/500ms, память – 64MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод copy
Послать решение Blockly Посылки Темы Где Обсудить (0)

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 final 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 Format
The input contains two strings `s`, `t` of alphanumeric ASCII characters separated by whitespace. Length of strings is from 1 to 100.
Output Format
The output consists of the string "Yes", if `s` is a subsequence of `t`, otherwise "No".

Sample Input #1

sequence subsequence

Sample Output #1

Yes

Sample Input #2

VERDI vivaVittorioEmanueleReDiItalia

Sample Output #2

Yes

Sample Input #3

person compression

Sample Output #3

No

Sample Input #4

caseDoesMatter CaseDoesMatter

Sample Output #4

No
loading