a = sorted(list(input())) b = sorted(list(input())) print("YES" if a == b else "NO")