#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
bool Max(T1& a, T2 b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T1, typename T2>
bool Min(T1& a, T2 b) {
  return a > b ? a = b, 1 : 0;
}
int hsb_loc(int n) { return 31 - __builtin_clz(n); }
int hsb_loc(long long n) { return 63 - __builtin_clzll(n); }
template <class T>
struct RMQ {
  int n;
  vector<T> d;
  RMQ() : n(0) {}
  template <class Iter>
  RMQ(Iter begin, Iter end) : n(0) {
    build(begin, end);
  }
  template <class Iter>
  void build(Iter begin, Iter end) {
    n = end - begin;
    if (n == 0) return;
    int g = hsb_loc(n);
    d.resize(n * (g + 1));
    g *= n;
    for (int i = 0; i < (n); ++i) {
      d[i] = *begin;
      ++begin;
    }
    for (int t = 1, b = 0; b < g; t <<= 1, b += n) {
      for (int i = 0, j = t; j <= n - t; i++, j++) {
        d[b + n + i] = min(d[b + i], d[b + j]);
      }
    }
  }
  const T rmq(int l, int r) const {
    int g = hsb_loc(r - l), b = n * g;
    r -= 1 << g;
    return min(d[b + l], d[b + r]);
  }
};
class SAIS {
 public:
  vector<int> S, sa, lcp, rank;
  int A_SIZE;
  SAIS() {}
  SAIS(const string& str, int A_SIZE_ = 128) : A_SIZE(A_SIZE_) {
    N = str.size() + 1;
    S = vector<int>(N);
    for (int i = 0; i < N; i++) S[i] = str[i];
    buildSA();
    buildLCP();
  }

 private:
  SAIS(vector<int>&& S_, int A_SIZE_) : S(S_), A_SIZE(A_SIZE_) { buildSA(); }
  int N;
  vector<int> t, B_old, B;
  enum { STYPE, LTYPE };
  inline bool is_lms(int i) {
    return i > 0 && t[i] == STYPE && t[i - 1] == LTYPE;
  }
  void induced_sort(const vector<int>& S1) {
    B = B_old;
    for (int i = S1.size(); i--;) {
      int j = S1[i];
      sa[--B[S[j]]] = j;
    }
    B = B_old;
    for (int i = 0; i < N; i++) {
      int j = sa[i] - 1;
      if (j >= 0 && S[j] >= S[j + 1]) sa[B[S[j] - 1]++] = j;
    }
    B = B_old;
    for (int i = N; i--;) {
      int j = sa[i] - 1;
      if (j >= 0 && S[j] <= S[j + 1]) sa[--B[S[j]]] = j;
    }
  }
  void buildSA() {
    N = S.size();
    sa.assign(N, -1);
    if (N == 1) {
      sa[0] = 0;
      return;
    }
    t.assign(N, STYPE);
    for (int i = N - 1; i--;)
      if (S[i] > S[i + 1] || (S[i] == S[i + 1] && t[i + 1] == LTYPE))
        t[i] = LTYPE;
    B_old = vector<int>(A_SIZE);
    for (int i = 0; i < N; i++) B_old[S[i]]++;
    for (int i = 0; i < A_SIZE - 1; i++) B_old[i + 1] += B_old[i];
    vector<int> P1;
    for (int i = 0; i < N; i++)
      if (is_lms(i)) P1.push_back(i);
    induced_sort(P1);
    int N1 = 0;
    for (int i = 0; i < N; i++)
      if (is_lms(sa[i])) sa[N1++] = sa[i];
    fill(sa.begin() + N1, sa.end(), -1);
    int name = 0, prev = -1;
    for (int i = 0; i < N1; i++) {
      int cur = sa[i];
      bool diff = (prev == -1) || S[cur] != S[prev];
      for (int j = 1; !diff; j++) {
        if (is_lms(cur + j) && is_lms(prev + j)) break;
        if (is_lms(cur + j) || is_lms(prev + j) || S[cur + j] != S[prev + j])
          diff = true;
      }
      if (diff) name++;
      sa[N1 + cur / 2] = name - 1;
      prev = cur;
    }
    vector<int> S1, sa1;
    for (int i = N1; i < N; i++)
      if (sa[i] >= 0) S1.push_back(sa[i]);
    if (name == N1) {
      sa1.resize(N1);
      for (int i = 0; i < N1; i++) sa1[S1[i]] = i;
    } else
      sa1 = SAIS(move(S1), name).sa;
    for (int i = 0; i < N1; i++) sa1[i] = P1[sa1[i]];
    fill(sa.begin(), sa.end(), -1);
    induced_sort(sa1);
  }
  void buildLCP() {
    rank.resize(N);
    lcp.resize(N - 1);
    for (int i = 0; i < N; i++) rank[sa[i]] = i;
    int h = 0;
    for (int i = 0; i < N - 1; i++) {
      int j = sa[rank[i] - 1];
      if (h > 0) h--;
      for (; j + h < N && i + h < N && S[j + h] == S[i + h]; h++)
        ;
      lcp[rank[i] - 1] = h;
    }
  }

 public:
  RMQ<int> rmq;
  void buildRMQ() { rmq = RMQ<int>(lcp.begin(), lcp.end()); }
  int get_lcp(int x, int y) {
    if (x == y) return N - 1 - x;
    x = rank[x];
    y = rank[y];
    if (x > y) swap(x, y);
    return rmq.rmq(x, y);
  }
};
int N;
int M;
string S, T;
int X;
pair<int, int> f[31];
void solve() {
  cin >> N >> S >> M >> T >> X;
  S += '$';
  SAIS sais(S + T);
  sais.buildRMQ();
  for (int i = 1; i <= (X); ++i) f[i] = {1e6, 0};
  int mxx = 0;
  for (int i = 0; i < (N); ++i)
    for (int j = mxx; j >= (0); --j) {
      if (f[j].first > i) continue;
      int t = f[j].second;
      if (M - t > N - i) continue;
      int cnt = sais.get_lcp(i, N + 1 + t);
      if (cnt && t + cnt > f[j + 1].second) {
        if (t + cnt == M) {
          cout << "YES" << '\n';
          return;
        }
        if (j == mxx && j < X - 1) mxx = j + 1;
        f[j + 1] = {i + cnt, t + cnt};
      }
    }
  cout << "NO" << '\n';
}
void init() {}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.setf(ios::fixed);
  cout.precision(20);
  init();
  int TC = 1;
  for (int TI = 1; TI <= (TC); ++TI) {
    solve();
  }
  return 0;
}
