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