#include <iostream>
#include <map>
using namespace std;
struct state {
int len, link;
map <char,int> next;
};
state st[2*100000];
int sz, last;
void sa_init() {
sz = 0;
last = 0;
st[0].len = 0;
st[0].link = -1;
sz++;
}
void sa_extend (char c) {
int cur = sz++;
st[cur].len = st[last].len + 1;
int p;
for (p = last; p != -1 && !st[p].next.count(c); p = st[p].link) st[p].next[c] = cur;
if (p == -1) st[cur].link = 0;
else {
int q = st[p].next[c];
if (st[p].len + 1 == st[q].len) st[cur].link = q;
else {
int clone = sz++;
st[clone].len = st[p].len + 1;
st[clone].next = st[q].next;
st[clone].link = st[q].link;
st[q].link = st[cur].link = clone;
}
}
last = cur;
}
int longer_common_string (string a, string b) {
sa_init();
for (int i = 0; i < a.length(); i++) sa_extend (a[i]);
int v = 0, l = 0, best = 0, bestpos = 0;
for (int i = 0; i < b.length(); i++) {
while (v != 0 && ! st[v].next.count(b[i])) {
v = st[v].link;
l = st[v].len;
}
if (st[v].next.count(b[i])) {
v = st[v].next[b[i]];
l++;
}
if (l > best){
best = l;
bestpos = i;
}
}
return best;
}
int main() {
string a, b;
int n;
cin >> a >> b >> n;
if (longer_common_string(a, b) >= n) cout << "YES";
else cout << "NO";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCnN0cnVjdCBzdGF0ZSB7CiAgICBpbnQgbGVuLCBsaW5rOwogICAgbWFwIDxjaGFyLGludD4gbmV4dDsKfTsKIApzdGF0ZSBzdFsyKjEwMDAwMF07IAppbnQgc3osIGxhc3Q7CiAKdm9pZCBzYV9pbml0KCkgewogICAgc3ogPSAwOwogICAgbGFzdCA9IDA7CiAgICBzdFswXS5sZW4gPSAwOwogICAgc3RbMF0ubGluayA9IC0xOwogICAgc3orKzsKfQogCnZvaWQgc2FfZXh0ZW5kIChjaGFyIGMpIHsKICAgIGludCBjdXIgPSBzeisrOwogICAgc3RbY3VyXS5sZW4gPSBzdFtsYXN0XS5sZW4gKyAxOwogICAgaW50IHA7CiAgICBmb3IgKHAgPSBsYXN0OyBwICE9IC0xICYmICFzdFtwXS5uZXh0LmNvdW50KGMpOyBwID0gc3RbcF0ubGluaykgc3RbcF0ubmV4dFtjXSA9IGN1cjsKICAgIGlmIChwID09IC0xKSBzdFtjdXJdLmxpbmsgPSAwOwogICAgZWxzZSB7CiAgICAgICAgaW50IHEgPSBzdFtwXS5uZXh0W2NdOwogICAgICAgIGlmIChzdFtwXS5sZW4gKyAxID09IHN0W3FdLmxlbikgc3RbY3VyXS5saW5rID0gcTsKICAgICAgICBlbHNlIHsKICAgICAgICAgICAgaW50IGNsb25lID0gc3orKzsKICAgICAgICAgICAgc3RbY2xvbmVdLmxlbiA9IHN0W3BdLmxlbiArIDE7CiAgICAgICAgICAgIHN0W2Nsb25lXS5uZXh0ID0gc3RbcV0ubmV4dDsKICAgICAgICAgICAgc3RbY2xvbmVdLmxpbmsgPSBzdFtxXS5saW5rOwogICAgICAgICAgICBzdFtxXS5saW5rID0gc3RbY3VyXS5saW5rID0gY2xvbmU7CiAgICAgICAgfQogICAgfQogICAgbGFzdCA9IGN1cjsKfQogCmludCBsb25nZXJfY29tbW9uX3N0cmluZyAoc3RyaW5nIGEsIHN0cmluZyBiKSB7CiAgICBzYV9pbml0KCk7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IGEubGVuZ3RoKCk7IGkrKykgc2FfZXh0ZW5kIChhW2ldKTsKICAgIGludCB2ID0gMCwgbCA9IDAsIGJlc3QgPSAwLCBiZXN0cG9zID0gMDsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgYi5sZW5ndGgoKTsgaSsrKSB7CiAgICAgICAgd2hpbGUgKHYgIT0gMCAmJiAhIHN0W3ZdLm5leHQuY291bnQoYltpXSkpIHsKICAgICAgICAgICAgdiA9IHN0W3ZdLmxpbms7CiAgICAgICAgICAgIGwgPSBzdFt2XS5sZW47CiAgICAgICAgfQogICAgICAgIGlmIChzdFt2XS5uZXh0LmNvdW50KGJbaV0pKSB7CiAgICAgICAgICAgIHYgPSBzdFt2XS5uZXh0W2JbaV1dOwogICAgICAgICAgICBsKys7CiAgICAgICAgfQogICAgICAgIGlmIChsID4gYmVzdCl7CiAgICAgICAgICAgIGJlc3QgPSBsOwogICAgICAgICAgICBiZXN0cG9zID0gaTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gYmVzdDsKfQogCmludCBtYWluKCkgewogICAgc3RyaW5nIGEsIGI7CiAgICBpbnQgbjsKICAgIGNpbiA+PiBhID4+IGIgPj4gbjsKICAgIGlmIChsb25nZXJfY29tbW9uX3N0cmluZyhhLCBiKSA+PSBuKSBjb3V0IDw8ICJZRVMiOwogICAgZWxzZSBjb3V0IDw8ICJOTyI7CiAgICByZXR1cm4gMDsKfQ==