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