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