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