print("YES" if ("".join(sorted(list(input()))) == "".join(sorted(list(input())))) else "NO")