LearnPy Hub
← Arena
AdvancedRating 1700

Wildcard Matching

In the pattern, ? matches any one character and * matches any sequence (also empty). Does the pattern match the whole text? Print YES or NO.

Input

The text, then the pattern (lengths ≤ 500; the text may be empty).

Output

YES or NO.

Sample 1

Input
aa
a
Output
NO

Sample 2

Input
aa
*
Output
YES
solution.py
Output appears here
Wildcard Matching · Python Arena problem · LearnPy Hub