#K53422. Typed Correctly?

    ID: 29528 Type: Default 1000ms 256MiB

Typed Correctly?

Typed Correctly?

Given two strings, (\texttt{keys}) and (\texttt{typed}), determine whether the sequence of characters in (\texttt{typed}) appears in the same order as in (\texttt{keys}). That is, check whether (\texttt{typed}) is a subsequence of (\texttt{keys}).

For example, if (\texttt{keys = "abcdefg"}) and (\texttt{typed = "abc"}), then the answer is yes because every character in (\texttt{typed}) appears in (\texttt{keys}) in the correct order. Otherwise, output no.

inputFormat

The input is read from standard input (stdin) and consists of two lines:
1. A string (\texttt{keys}) representing the configuration of the keyboard.
2. A string (\texttt{typed}) representing the sequence of characters that were typed.

outputFormat

Output a single line to standard output (stdout) containing yes if (\texttt{typed}) is a subsequence of (\texttt{keys}) (i.e., if all characters in (\texttt{typed}) can be found in (\texttt{keys}) in the same order), otherwise output no.## sample

abcdefg
abc
yes