3.1 Sacred Strings
(RankList for this Question)
Score: 30pts
Time Limit: 1.00 sec
A nuclear bomb is about to go off in Mumbai and Sartaj Singh is determined to stop it. He finds a van in an abandoned parking lot, inside the van is a computer which is displaying two buttons ‘YES’ and ‘NO’. Sartaj finds a piece of paper next to the van and he thinks that it could be linked to the computer inside. Two strings \(x\) and \(y\) are printed on the paper. Sartaj has come up with a possible solution, if deleting some characters from \(y\) would result in \(x\) he should press ‘YES’ and if not then he should press ‘NO’. Help him find what button he should press to save Mumbai.

Constraints
\(1 \leq\) length of string x and y \(\leq 8000\)

Input Format
The first line contains the first string \(x\) and the second line contains the second string \(y\).

Output Format
Print either “YES” or “NO”.

Example 1
Input:
cat
chocolate

Output:
YES

Explanation:
Deleting h, o, c, o, l and e would result in ‘cat’ which is the first string.

Example 2
Input:
dog
dancing

Output:
NO

Explanation:
The first string cannot be obtained from the second string as it doesn’t have all the characters from the first string.

Log In to solve the Question