import java.io.;
import java.util.;
public class Main{
public static void main(String arges[]) throws Exception{
Scanner cin = new Scanner(System.in);
var k = cin.nextDouble();
String str1 = cin.next();
String str2 = cin.next();
char c1[] = str1.toCharArray(); //利用toCharArray方法转换,将字符串转换成字符数组;
char c2[] = str2.toCharArray(); //利用toCharArray方法转换,将字符串转换成字符数组;
int cnt = 0;
int d = str1.length();
for(int i = 0; i < c1.length; i++){
if(c1[i] == c1[i]){
cnt ++;
}
}
if((double)(cnt / d) >= k) System.out.printf("yes");
else System.out.printf("no");
}
}