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