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