#include <bits/stdc++.h>
using namespace std;
const int N = 100000, X = 35;
const int MOD = 998796243, base = 55553;
int n, m, x;
int p[N + 10], hashS[N + 10], hashT[N + 10], f[N + 10][X];
char s[N + 10], t[N + 10];
void Prepare() {
  p[0] = 1;
  for (int i = 1; i <= N; i++) p[i] = 1LL * p[i - 1] * base % MOD;
  for (int i = 1; i <= n; i++)
    hashS[i] = (1LL * hashS[i - 1] * base + s[i]) % MOD;
  for (int i = 1; i <= m; i++)
    hashT[i] = (1LL * hashT[i - 1] * base + t[i]) % MOD;
}
inline int getHash(int hash[], int L, int R) {
  return ((hash[R] - 1LL * hash[L] * p[R - L] % MOD) % MOD + MOD) % MOD;
}
inline int LCP(int a, int b) {
  int l = 0, r = min(n - a, m - b), mid;
  while (l < r) {
    mid = (l + r + 1) >> 1;
    if (getHash(hashS, a, a + mid) == getHash(hashT, b, b + mid))
      l = mid;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  scanf("%d%s%d%s%d", &n, s + 1, &m, t + 1, &x);
  Prepare();
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= x; j++) {
      int tmp = LCP(i, f[i][j]);
      f[i + 1][j] = max(f[i + 1][j], f[i][j]);
      f[i + tmp][j + 1] = max(f[i + tmp][j + 1], f[i][j] + tmp);
    }
  for (int i = x; i >= 0; i--)
    if (f[n][i] == m) {
      puts("YES");
      return 0;
    }
  puts("NO");
  return 0;
}
