#include <bits/stdc++.h>
using namespace std;
int x[500010], s[500010], y[500010], sa[500010], rk[500010], c[500010];
int n, m;
int stmin[500010][30];
int lg[500010];
void log(int n) {
  int i;
  for (i = 1; i <= n; i++) lg[i] = lg[i - 1] + (1 << lg[i - 1] == i);
}
int query(int l, int r) {
  int k = lg[r - l + 1] - 1;
  return min(stmin[l][k], stmin[r - (1 << k) + 1][k]);
}
void getmin(int n) {
  int i, j;
  for (j = 1; j <= 25; j++)
    for (i = 1; i <= n + 1 - (1 << j); i++)
      stmin[i][j] = min(stmin[i][j - 1], stmin[i + (1 << (j - 1))][j - 1]);
}
void getsa() {
  int i;
  for (i = 1; i <= n; i++) c[x[i] = s[i]]++;
  for (i = 1; i <= m; i++) c[i] += c[i - 1];
  for (i = n; i >= 1; i--) sa[c[x[i]]--] = i;
  int k;
  for (k = 1; k <= n; k = k << 1) {
    int num = 0;
    for (i = n - k + 1; i <= n; i++) y[++num] = i;
    for (i = 1; i <= n; i++)
      if (sa[i] > k) y[++num] = sa[i] - k;
    for (i = 1; i <= m; i++) c[i] = 0;
    for (i = 1; i <= n; i++) c[x[i]]++;
    for (i = 2; i <= m; i++) c[i] += c[i - 1];
    for (i = n; i >= 1; i--) sa[c[x[y[i]]]--] = y[i], y[i] = 0;
    for (i = 1; i <= n; i++) y[i] = x[i];
    x[sa[1]] = 1;
    num = 1;
    for (i = 2; i <= n; i++)
      x[sa[i]] = (y[sa[i]] == y[sa[i - 1]] && y[sa[i] + k] == y[sa[i - 1] + k])
                     ? num
                     : ++num;
    if (num == n) break;
    m = num;
  }
}
int height[500010];
void getheight() {
  int k = 0;
  int i;
  for (i = 1; i <= n; i++) rk[sa[i]] = i;
  for (i = 1; i <= n; i++) {
    if (rk[i] == 1) continue;
    if (k) k--;
    int j = sa[rk[i] - 1];
    while (j + k <= n && i + k <= n && s[i + k] == s[j + k]) k++;
    height[rk[i]] = k;
    stmin[rk[i]][0] = k;
  }
}
int lcp(int x, int y) {
  int ans = 0x7fffffff;
  int i;
  x = rk[x];
  y = rk[y];
  if (x > y) swap(x, y);
  return query(x + 1, y);
}
int dp[500010][35];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  log(500010 - 5);
  int a, b, i, j;
  cin >> a;
  string temp = "%";
  string t;
  cin >> t;
  temp += t;
  temp += "$";
  cin >> b;
  cin >> t;
  temp += t;
  for (i = 1; i <= a + b + 1; i++) s[i] = temp[i];
  n = a + b + 1;
  m = 200;
  getsa();
  getheight();
  getmin(n);
  int maxx;
  cin >> maxx;
  for (i = 1; i <= a + 1; i++) {
    for (j = 0; j <= maxx; j++) {
      dp[i][j] = max(dp[i][j], dp[i - 1][j]);
      if (dp[i][j] == b) {
        cout << "YES";
        return 0;
      }
      if (i == a + 1) continue;
      int temp = lcp(i, a + 2 + dp[i][j]);
      dp[i + temp][j + 1] = max(dp[i + temp][j + 1], dp[i][j] + temp);
    }
  }
  cout << "NO";
}
