#K89377. Subsequence Determination

    ID: 37517 Type: Default 1000ms 256MiB

Subsequence Determination

Subsequence Determination

Given two strings a and b, determine whether b is a subsequence of a. A string b is a subsequence of a if all characters of b appear in a in the same order (not necessarily consecutively). Formally, if b has length k, then there exist indices \(i_1, i_2, \dots, i_k\) in a such that:

[ a[i_1] = b[0],\quad a[i_2] = b[1],\quad \dots,\quad a[i_k] = b[k-1] ]

Your task is to read two strings from stdin and output YES if b is a subsequence of a and NO otherwise.

inputFormat

The input consists of two lines. The first line contains the string a and the second line contains the string b. Both strings consist of only visible characters without spaces.

outputFormat

Output a single line with YES if b is a subsequence of a, and NO otherwise.

## sample
abcde
ace
YES