~/algor $ cat problems/ikki-korsatkich-qism-ketma-ketlik
Is it a subsequence?
Easy
1000 ms
128 MB
33%
Two strings $s$ and $t$ are given. Can $s$ be obtained by deleting some letters from $t$ (possibly none) without changing the order of the rest? For example, the string abc can be obtained from ahbgdc, but axc cannot. If it can, print YES, otherwise NO.
Input
The first line contains $s$, the second line contains $t$.
Output
YES or NO.
Note
$1 \le |s|, |t| \le 10^{5}$
the strings consist of lowercase Latin letters
Examples
Input #1
abc ahbgdc
Output #1
YES
Input #2
axc ahbgdc
Output #2
NO