#include <bits/stdc++.h>
using namespace std;
int f[100005][35];
unsigned long long sq[100005], ha1[100005], ha2[100005];
int n, m, mxans;
unsigned long long gethash(int Type, int x, int y) {
  if (Type == 1)
    return (ha1[y] - ha1[x - 1] * sq[y - x + 1] % 998244353 + 998244353) %
           998244353;
  else
    return (ha2[y] - ha2[x - 1] * sq[y - x + 1] % 998244353 + 998244353) %
           998244353;
}
int getlcp(int x, int y) {
  int l = 1, r = min(n - x + 1, m - y + 1), ret = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (gethash(1, x, x + mid - 1) == gethash(2, y, y + mid - 1)) {
      ret = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ret;
}
int main() {
  sq[0] = 1;
  for (int i = 1; i <= 100000; i++) sq[i] = sq[i - 1] * 29 % 998244353;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    char c = getchar();
    while (c < 'a' || c > 'z') c = getchar();
    ha1[i] = (ha1[i - 1] * 29 + c - 'a' + 1) % 998244353;
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    char c = getchar();
    while (c < 'a' || c > 'z') c = getchar();
    ha2[i] = (ha2[i - 1] * 29 + c - 'a' + 1) % 998244353;
  }
  scanf("%d", &mxans);
  int ptmp = getlcp(1, 1);
  f[ptmp][1] = ptmp;
  for (int i = 0; i <= n - 1; i++)
    for (int j = 0; j <= mxans; j++) {
      f[i + 1][j] = max(f[i + 1][j], f[i][j]);
      if (f[i][j] == m) {
        puts("YES");
        return 0;
      }
      int tmp = getlcp(i + 1, f[i][j] + 1);
      f[tmp + i][j + 1] = max(f[tmp + i][j + 1], f[i][j] + tmp);
    }
  for (int i = 1; i <= mxans; i++)
    if (f[n][i] == m) {
      puts("YES");
      return 0;
    }
  puts("NO");
  return 0;
}
