#include<iostream> #include<cstring> #include<cstdio> #include<cstdlib> using namespace std; double num; char a[1000001]; char b[1000001]; char c[1]; int main() { double tot=0; scanf("%lf",&num); gets(c); gets(a); gets(b); int l=strlen(a); for(int i=0;i<=l;i++) { if(a[i]==b[i])tot++; } if((double)tot/l>num) { cout<<"yes"; } else cout<<"no"; return 0; }