import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd n = int(input()) s = input().rstrip() t = input().rstrip() all = 0 ok = 1 cnt = 0 for i in range(n): if (ord(s[i])) > ord(t[i]): ok = 0 all += ord(t[i]) - ord(s[i]) cnt += (ord(t[i]) - ord(s[i])) >= 1 if ok and all% 2 == 0: if all == 0: print('Yes') elif cnt == 1: print('No') else: print('Yes') else: print('No')