Pattern and word
Problem
It is required to determine whether the specified word matches the specified template. The template is specified in capital Latin letters, the signs "?" - any character, "*" - any sequence of characters (even empty ones).
Input
The first two lines contain a pattern and a word: one of them contains a pattern - a sequence of large Latin letters, "?" and "*", in another - a word consisting only of uppercase Latin letters (lines shorter than 100 characters).
Imprint
Print YES if the word matches, NO if it doesn't.
Examples
# |
Input |
Output |
1 |
ABBCDA
A*CDA
|
YES |
2 |
AADAAVA
A*DA*AA*
|
NO |