'use strict';

const fs = require('fs');

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', function(inputStdin) {
    inputString += inputStdin;
});

process.stdin.on('end', function() {
    inputString = inputString.split('\n');

    main();
});

process.on('SIGINT', function() {
    inputString = inputString.split('\n');

    main();
    process.exit(0);
});

function readLine() {
    return inputString[currentLine++];
}

/*
 * Complete the 'appendAndDelete' function below.
 *
 * The function is expected to return a STRING.
 * The function accepts following parameters:
 *  1. STRING s
 *  2. STRING t
 *  3. INTEGER k
 */

function appendAndDelete(s, t, k) {
    let max = 0, res;
    s = s.trim();
    t = t.trim();
    // console.log(`s: ${s}, t: ${t}`);

    let queue = [[s, 0]];
    while (queue.length) {
        let [word, steps] = queue.pop();
        // console.log(`Word: ${word}, steps: ${steps}`);
        if (word === t && steps === k) {
            // console.log('Yes');
            return "Yes";
        }

        if (steps >= k) {
            continue;
        }
        queue.unshift([word.length ? word.slice(0, word.length - 1): '', steps+1]);
        let increment = word.length >= t.length ? 'x' : t[word.length];
        queue.unshift([word + increment, steps+1]);
    }

    // console.log('No');

    return "No";

}

function main() {
    const ws = fs.createWriteStream(process.env.OUTPUT_PATH);

    const s = readLine();

    const t = readLine();

    const k = parseInt(readLine().trim(), 10);

    const result = appendAndDelete(s, t, k);

    ws.write(result + '\n');

    ws.end();
}
