#include <iostream>
using namespace std;
int main()
{
double k;
string a, b;
cin >> k >> 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;
}