#include <bits/stdc++.h>
using namespace std;
namespace hjx {
int read() {
  int res = 0, f = 1;
  char a = getchar();
  while (a < '0' || a > '9') {
    if (a == '-') f = -1;
    a = getchar();
  }
  while (a >= '0' && a <= '9') res = res * 10 + a - '0', a = getchar();
  return res * f;
}
void writ(int x) {
  static int st[22];
  int t = 0;
  bool f = 0;
  if (x < 0) f = 1, x = -x;
  if (!x) st[++t] = 0;
  while (x) st[++t] = x % 10, x /= 10;
  if (f) putchar('-');
  while (t) putchar(st[t--] + '0');
}
const int se[] = {2333, 9973};
const int mo[] = {1000000007, 998244353};
unsigned long long h1[2][100005], h2[2][100005], powse[2][100005];
unsigned long long gethash(unsigned long long* h, unsigned long long* pe, int l,
                           int r, int p) {
  return (h[r] - h[l - 1] * pe[r - l + 1] % p + p) % p;
}
int len1, len2;
int getlcp(int p1, int p2) {
  int mid, res = 0, l = 0, r = min(len1 - p1 + 1, len2 - p2 + 1);
  while (l <= r) {
    mid = (l + r) >> 1;
    if (gethash(h1[0], powse[0], p1, p1 + mid - 1, mo[0]) ==
            gethash(h2[0], powse[0], p2, p2 + mid - 1, mo[0]) &&
        gethash(h1[1], powse[1], p1, p1 + mid - 1, mo[1]) ==
            gethash(h2[1], powse[1], p2, p2 + mid - 1, mo[1]))
      l = mid + 1, res = mid;
    else
      r = mid - 1;
  }
  return res;
}
char s[100005];
int dp[100005][35];
void upd(int& x, int y) {
  if (y > x) x = y;
}
int main() {
  len1 = read();
  scanf("%s", s + 1);
  int maxl = len1;
  for (int j = 0; j < 2; j++)
    for (int i = 1; i <= len1; i++)
      h1[j][i] = (h1[j][i - 1] * se[j] + s[i]) % mo[j];
  len2 = read();
  scanf("%s", s + 1);
  maxl = max(maxl, len2);
  for (int j = 0; j < 2; j++)
    for (int i = 1; i <= len2; i++)
      h2[j][i] = (h2[j][i - 1] * se[j] + s[i]) % mo[j];
  for (int j = 0; j < 2; j++) {
    powse[j][0] = 1;
    for (int i = 1; i <= maxl; i++)
      powse[j][i] = powse[j][i - 1] * se[j] % mo[j];
  }
  int K = read();
  dp[0][0] = 0;
  bool ans = 0;
  for (int t, i = 0; i <= len1; i++)
    for (int j = 0; j <= K; j++) {
      if (dp[i][j] >= len2) {
        ans = 1;
        break;
      }
      upd(dp[i + 1][j], dp[i][j]);
      t = getlcp(i + 1, dp[i][j] + 1);
      upd(dp[i + t][j + 1], dp[i][j] + t);
    }
  puts(ans ? "YES" : "NO");
  return 0;
}
}  // namespace hjx
int main() { return hjx::main(); }
