i=input print("YES" if sorted(i())==sorted(i()) else "NO")