a,p,q=input().split() N=len(p) M=len(q) if N!=M: print('Yes') else: for i in range(N): if p[i]!=q[i]: print('Yes') exit() print('No')