Problem B: Matching Problem [Easy]

## Problem B: Matching Problem [Easy]

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 2121  Solved: 277
[Submit][Status][Web Board]

## Description

Hong haves two strings s and t. The length of the string s equals n, the length of the string t equals m. The string s consists of lowercase letters and at most one wildcard character '*', while the string t consists only of lowercase letters.

The wildcard character '*' in the string s (if any) can be replaced with an arbitrary sequence (possibly void sequence) of lowercase letters. If it is possible to replace a wildcard character '*' in s to obtain a string t, then the string t matches the pattern s.

If the given string t matches the given string s, print "YES", otherwise print "NO".

## Input

The first line will be an integer T (1≤T≤10), which is the number of test cases.

For each test data:

The first line contains two integers n and m (1≤n, m≤210^5) — the length of the string s and the length of the string t, respectively.

The second line contains string s of length n, which consists of lowercase letters and at most one wildcard character '*'.

The third line contains string t of length m, which consists only of lowercase letters.

## Output

For each test cases, print "YES" (without quotes), if you can obtain the string t from the string s. Otherwise print "NO" (without quotes).

## Sample Input

1
7 10
aba*aba
abazzzzaba


## Sample Output

YES


[Submit][Status]