#include <bits/stdc++.h>
using namespace std;
mt19937 gen(time(NULL));
const long double eps = 1e-9;
const int inf = 1e9;
const int mod = 1e9 + 7;
const long long infinity = 2 * 1e18;
long long pw[200005];
long long hs[200005], ht[200005];
string s, t;
int n, m;
const int P = 23917;
void precalc() {
  pw[0] = 1;
  for (int i = 0; i < n; i++) hs[i + 1] = hs[i] * P + s[i];
  for (int i = 0; i < m; i++) ht[i + 1] = ht[i] * P + t[i];
  for (int i = 0; i < max(n, m); i++) pw[i + 1] = pw[i] * P;
}
long long gets(int l, int r) { return hs[r] - hs[l] * pw[r - l]; }
long long gett(int l, int r) { return ht[r] - ht[l] * pw[r - l]; }
int dp[35][200005];
int ok(int x, int i, int j) {
  int l = 0, r = i + 1, ans = 0;
  while (l <= r) {
    int m = (l + r) / 2;
    if (gets(i - m + 1, i + 1) == gett(j - m + 1, j + 1)) {
      l = m + 1;
      ans = m;
    } else
      r = m - 1;
  }
  return ans;
}
void dq(int x, int l, int r, int L, int R) {
  if (l > r) return;
  int m = (l + r) / 2;
  for (int i = L; i <= R; i++) {
    int s = ok(x, m, i);
    if (!s) continue;
    if ((dp[x - 1][m - s] != -1 && dp[x - 1][m - s] + s <= i) || (s == m + 1)) {
      dp[x][m] = i;
      break;
    }
  }
  if (l == r) return;
  if (dp[x][m] == -1)
    dq(x, l, m - 1, L, R);
  else {
    dq(x, l, m - 1, L, dp[x][m]);
    dq(x, m + 1, r, dp[x][m], R);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> m;
  cin >> t;
  cin >> n;
  cin >> s;
  int u;
  cin >> u;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 35; j++) dp[j][i] = -1;
  precalc();
  int j = 0;
  for (int i = 0; i < n; i++) {
    while (j < m && gett(j - i, j + 1) != gets(0, i + 1)) j++;
    if (j == m) break;
    dp[1][i] = j;
  }
  for (int x = 2; x <= u; x++) dq(x, 0, n - 1, 0, m - 1);
  if (dp[u][n - 1] == -1)
    cout << "NO";
  else
    cout << "YES";
}
