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