#include <iostream>
#include <cstring>
using namespace std;
int main()
{
double x;
cin >> x;
string a,b;
cin >> a >> b;
int sum = 0;
int c = a.size();
for(int i = 0;i < c;i++)
if(a[i]==b[i]) sum++;
double y = static_cast<double>(sum) / a.size();
if (y>=x) cout << "yes" << endl;
else cout << "no" << endl;
return 0;
}