#include <bits/stdc++.h>
using namespace std;
int n, m, x, f[200010][50];
char s[200010], t[200010];
bool Q = false;
long long a[200010], b[200010], c[200010], d[200010], F[200010], G[200010];
long long AskA(int l, int r) {
  long long tA = (a[r] - a[l - 1] * F[r - l + 1] % 1000000007 + 1000000007);
  long long tB = (c[r] - c[l - 1] * G[r - l + 1] % 1000000007 + 1000000007);
  return (tA * tB) % 1000000007;
}
long long AskB(int l, int r) {
  long long tA = (b[r] - b[l - 1] * F[r - l + 1] % 1000000007 + 1000000007);
  long long tB = (d[r] - d[l - 1] * G[r - l + 1] % 1000000007 + 1000000007);
  return (tA * tB) % 1000000007;
}
int main() {
  scanf("%d%s%d%s%d", &n, s + 1, &m, t + 1, &x);
  a[0] = b[0] = c[0] = d[0] = 0;
  F[0] = G[0] = 1;
  for (int i = 1; i <= n; i++) {
    a[i] = (a[i - 1] * 131 + s[i]) % 1000000007;
    c[i] = (c[i - 1] * 29 + s[i]) % 1000000007;
  }
  for (int i = 1; i <= m; i++) {
    b[i] = (b[i - 1] * 131 + t[i]) % 1000000007;
    d[i] = (d[i - 1] * 29 + t[i]) % 1000000007;
  }
  for (int i = 1; i <= 200000; i++) {
    F[i] = F[i - 1] * 131 % 1000000007;
    G[i] = G[i - 1] * 29 % 1000000007;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < x; j++) {
      f[i][j] = max(f[i][j], f[i - 1][j]);
      int l = f[i][j], r = min(n - i + f[i][j] + 1, m);
      while (l < r) {
        int mid = (l + r + 1) >> 1;
        if (AskA(i, mid - f[i][j] - 1 + i) == AskB(f[i][j] + 1, mid))
          l = mid;
        else
          r = mid - 1;
      }
      if (f[i + r - f[i][j]][j + 1] < r) f[i + r - f[i][j]][j + 1] = r;
      if (r == m) Q = true;
    }
  puts(Q ? "YES" : "NO");
  return 0;
}
