LearnPy Hub
← Arena
AdvancedRating 1800

Interleaving Strings

Print YES if the third string is formed by interleaving the first two (keeping their internal order).

Input

Three lines.

Output

YES or NO.

Sample 1

Input
aabcc
dbbca
aadbbcbcac
Output
YES

Sample 2

Input
aabcc
dbbca
aadbbbaccc
Output
NO
solution.py
Output appears here
Interleaving Strings · Python Arena problem · LearnPy Hub