Template and word
We are considering words made up of uppercase Latin letters and patterns composed of uppercase Latin letters along with the symbols "?" and "*". A word matches a pattern if each "?" in the pattern can be substituted with any uppercase Latin letter, and each "*" can be replaced with any sequence (including an empty sequence) of uppercase Latin letters, resulting in a string that matches the word exactly. Write a program to determine if the word matches the given pattern.
Input
The input consists of two lines: the first line contains the pattern, which is a sequence of uppercase Latin letters, "?", and "*". The second line contains the word, which consists solely of uppercase Latin letters. Each line is shorter than 256 characters.
Output
Print YES if the word matches the pattern, or NO if it does not.