#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, k, l;
  cin >> n >> m;
  string s, t;
  cin >> s >> t;
  if (s == t) {
    cout << "Yes" << endl;
    return 0;
  }
  long long int present = 0;
  long long int flag = 0;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '*') {
      present = 1;
      break;
    }
  }
  if (present == 0) {
    cout << "No" << endl;
    return 0;
  } else {
    for (i = 0; i < s.length(); i++) {
      if (s[i] == '*') {
        break;
      } else if (s[i] != t[i]) {
        flag = 1;
        break;
      } else {
        t[i] = 'X';
      }
    }
  }
  if (flag == 0) {
    long long int ind = t.length() - 1;
    for (i = s.length() - 1; i >= 0; i--) {
      if (s[i] == '*') {
        break;
      }
      if (s[i] != t[ind]) {
        flag = 1;
        break;
      }
      ind--;
    }
  }
  if (flag == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
