#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const long long INF = 1e18 + 1LL;
const double pi = acos(-1.0);
const int N = 5e5 + 5, M = 1e3 + 20, inf = 2e9 + 10;
int *ran, r[N], sa[N], height[N], wa[N], wb[N], wm[N];
bool cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void SA(int *r, int *sa, int n, int m) {
  int *x = wa, *y = wb, *t;
  for (int i = 0; i < m; ++i) wm[i] = 0;
  for (int i = 0; i < n; ++i) wm[x[i] = r[i]]++;
  for (int i = 1; i < m; ++i) wm[i] += wm[i - 1];
  for (int i = n - 1; i >= 0; --i) sa[--wm[x[i]]] = i;
  for (int i = 0, j = 1, p = 0; p < n; j = j * 2, m = p) {
    for (p = 0, i = n - j; i < n; ++i) y[p++] = i;
    for (i = 0; i < n; ++i)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (i = 0; i < m; ++i) wm[i] = 0;
    for (i = 0; i < n; ++i) wm[x[y[i]]]++;
    for (i = 1; i < m; ++i) wm[i] += wm[i - 1];
    for (i = n - 1; i >= 0; --i) sa[--wm[x[y[i]]]] = y[i];
    for (t = x, x = y, y = t, i = p = 1, x[sa[0]] = 0; i < n; ++i) {
      x[sa[i]] = cmp(y, sa[i], sa[i - 1], j) ? p - 1 : p++;
    }
  }
  ran = x;
}
void Height(int *r, int *sa, int n) {
  for (int i = 0, j = 0, k = 0; i < n; height[ran[i++]] = k)
    for (k ? --k : 0, j = sa[ran[i] - 1]; r[i + k] == r[j + k]; ++k)
      ;
}
int dp[N][30];
int n, m, f[N][33];
char s[N], t[N];
void Lcp_init() {
  for (int i = 1; i <= n + m + 1; ++i) dp[i][0] = height[i];
  for (int j = 1; (1 << j) <= n + m + 1; ++j) {
    for (int i = 1; i + (1 << j) - 1 <= n + m - 1; ++i) {
      dp[i][j] = min(dp[i][j - 1], dp[i + (1 << (j - 1))][j - 1]);
    }
  }
}
int lcp(int l, int r) {
  l = ran[l], r = ran[r];
  if (l > r) swap(l, r);
  ++l;
  int len = r - l + 1;
  int k = 0;
  while ((1 << (k + 1)) <= len) ++k;
  return min(dp[l][k], dp[r - (1 << k) + 1][k]);
}
int main() {
  scanf("%d%s%d%s", &n, s, &m, t);
  for (int i = 0; i < n; ++i) r[i] = s[i] - 'a' + 1;
  r[n] = '*';
  for (int i = n + 1; i < m + n + 1; ++i) r[i] = t[i - n - 1] - 'a' + 1;
  r[n + m + 1] = 0;
  SA(r, sa, n + m + 1 + 1, 256);
  Height(r, sa, n + m + 1);
  Lcp_init();
  int X;
  scanf("%d", &X);
  int mx = 0;
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= X; ++j) {
      f[i + 1][j] = max(f[i + 1][j], f[i][j]);
      int t = lcp(i, f[i][j] + n + 1);
      f[i + t][j + 1] = max(f[i + t][j + 1], f[i][j] + t);
      mx = max(f[i][j], mx);
    }
  }
  if (mx == m)
    puts("YES");
  else
    puts("NO");
  return 0;
}
