#include <bits/stdc++.h>
using namespace std;
void Oli() {
  int a, b;
  cin >> a >> b;
  string s, t;
  cin >> s >> t;
  int i1 = 0;
  int i2 = 0;
  string b1 = "";
  string c1 = "";
  bool f = false;
  for (int i = 0; i < a; i++) {
    if (s[i] == '*') {
      i1 = i - 1;
      i2 = i + 1;
      f = true;
    } else if (!f) {
      b1 += s[i];
    } else {
      c1 += s[i];
    }
  }
  if (!f)
    if (s == t) {
      cout << "Yes";
      return;
    } else {
      cout << "No" << endl;
      return;
    }
  string b2 = "";
  string c2 = "";
  for (int i = 0; i <= i1; i++) {
    b2 += t[i];
  }
  for (int i = t.size() - c1.size(); i <= t.size() - 1; i++) {
    c2 += t[i];
  }
  if (b2 == b1 && c1 == c2 && s.size() - 1 <= t.size()) {
    cout << "YES";
  } else {
    cout << "NO" << endl;
  }
}
int main() {
  int times = 1;
  while (times--) Oli();
}
