B - Wild Card Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MiB

配点 : 200 点

問題文

S は英小文字からなる長さ N の文字列です。
T は英小文字および * からなる長さ N の文字列です。
S が T にマッチするとは、T に含まれる * をそれぞれ好きな英小文字で置き換えることで T を S に一致させられることをいいます。
S が T にマッチするかどうかを判定してください。

制約

  • 1 \leq N \leq 100
  • S は英小文字からなる長さ N の文字列
  • T は英小文字および * からなる長さ N の文字列

入力

入力は以下の形式で標準入力から与えられる。

N  
S  
T  

出力

S が T にマッチするならば Yes を、マッチしないならば No を 1 行で出力せよ。


入力例 1

8
chokudai
**o*u*ai

出力例 1

Yes

T の 1,2,4,6 文字目の * をそれぞれ c,h,k,d に置き換えることで T を S に一致させることができます。


入力例 2

5
snuke
snake

出力例 2

No

入力例 3

5
yiwiy
*****

出力例 3

Yes

Score : 200 points

Problem Statement

S is a string of length N consisting of lowercase English letters.
T is a string of length N consisting of lowercase English letters and *.
We say that S matches T if and only if T can be made equal to S by replacing each * in T with some lowercase English letter.
Determine whether S matches T.

Constraints

  • 1 \leq N \leq 100
  • S is a string of length N consisting of lowercase English letters.
  • T is a string of length N consisting of lowercase English letters and *.

Input

The input is given from Standard Input in the following format:

N  
S  
T  

Output

Output Yes if S matches T, and No otherwise, in one line.


Sample Input 1

8
chokudai
**o*u*ai

Sample Output 1

Yes

By replacing the first, second, fourth, and sixth characters of T, which are *, with c, h, k, and d, respectively, T can be made equal to S.


Sample Input 2

5
snuke
snake

Sample Output 2

No

Sample Input 3

5
yiwiy
*****

Sample Output 3

Yes