#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9 + 10;
const int mod = (int)1e8 + 123;
const int N = (int)1e6 + 10;
const long long LLINF = (long long)8e18 + 10;
const double pi = acos(-1.0);
template <typename T1, typename T2>
bool umin(T1 &x, const T2 &y) {
  if (x > y) return x = y, true;
  return false;
}
template <typename T1, typename T2>
bool umax(T1 &x, const T2 &y) {
  if (x < y) return x = y, true;
  return false;
}
template <typename T>
T getint() {
  char c = getchar();
  T p = 1, x = 0;
  while (c == ' ' || c == '\n') c = getchar();
  if (c == '-') p = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * p;
}
long long p[N];
vector<long long> h1, h2;
string a, b;
int n, m, k;
long long ans[31][(int)2e5];
void gethash(string s, vector<long long> &h) {
  for (int i = 0; i < s.size(); ++i) {
    p[i] = (i ? (p[i - 1] * 31 % mod) : 1);
    h.push_back((h.size() ? h.back() : 0) + p[i] * (s[i] - 'a' + 1));
    h.back() %= mod;
  }
}
long long seg(vector<long long> &h, int l, int r) {
  if (l < 0) return -1;
  long long res = h[r] - (l ? h[l - 1] : 0);
  if (res < 0) res += mod;
  return res;
}
int get(int i, int j) {
  int l = 0, r = min(n, m) + 1;
  while (r - l > 1) {
    int m = (l + r) / 2;
    long long a = seg(h1, i - m + 1, i);
    long long b = seg(h2, j - m + 1, j);
    a = a * p[max(0, j - i)] % mod;
    b = b * p[max(0, i - j)] % mod;
    if (a == b && a != -1)
      l = m;
    else
      r = m;
  }
  return l;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(0);
  cin >> n >> a >> m >> b >> k;
  gethash(a, h1);
  gethash(b, h2);
  for (int i = 0; i < n; ++i) ans[0][i] = n;
  for (int i = 1; i <= k; ++i) {
    for (int j = 0; j < m; ++j) {
      int r = (j ? ans[i][j - 1] : -1);
      while (r < n) {
        ++r;
        int len = get(r, j);
        if (!len) continue;
        if (len == j + 1 || ans[i - 1][j - len] <= r - len) break;
      }
      ans[i][j] = r;
    }
  }
  cout << (ans[k][m - 1] < n ? "YES" : "NO");
  return 0;
}
