#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double k;
string a, b;
cin >> k >> a >> b;
int n = 0;
for(int i = 0; i <a.size(); i++)
if(a[i] == b[i]) n++;
if(n * 1.0 / a.size() >= k) cout << "yes";
else cout << "no";
return 0;
}