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