#include <bits/stdc++.h>
using namespace std;
int n;
char s1[300003];
char s2[100001];
int main() {
  int i, j, m = 0;
  char c;
  cin >> n;
  i = j = 0;
  while (j <= n) {
    c = getchar();
    if (c >= 'a' && c <= 'z') {
      s1[i] = c;
      i++;
    } else {
      j++;
      s1[i] = '<';
      s1[i + 1] = '3';
      i += 2;
    }
  }
  scanf("%s", s2);
  i = j = 0;
  while (1) {
    if (s1[i] == 0) {
      m = 1;
      break;
    }
    if (s2[j] == 0) break;
    if (s1[i] == s2[j]) {
      i++;
      j++;
    } else
      j++;
  }
  cout << (m ? "yes" : "no") << endl;
  return 0;
}
