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