x = float(input()) a = input() b = input() s = 0 for i in range(len(a)): if a[i] == b[i]: s += 1 if s / len(a) >= x: print("yes") else: print("no")