#K61007. Is Subsequence?

    ID: 31213 Type: Default 1000ms 256MiB

Is Subsequence?

Is Subsequence?

Given two strings s1 and s2, determine whether s1 is a subsequence of s2. A subsequence of a string is obtained by deleting zero or more characters without changing the order of the remaining characters. Formally, if s2 is represented as \(c_1 c_2 \ldots c_n\), then s1 is a subsequence of s2 if there exists a sequence of indices \(1 \le i_1 < i_2 < \ldots < i_k \le n\) such that </em>s1 = c_{i_1} c_{i_2} \ldots c_{i_k}\.

Your task is to read the two input strings from standard input and output True if s1 is a subsequence of s2, otherwise output False.

inputFormat

The input consists of two lines:

  1. The first line contains the string s1.
  2. The second line contains the string s2.

Note that the strings can be empty.

outputFormat

Output a single line: True if s1 is a subsequence of s2, or False otherwise.

## sample
abc
ahbgdc
True