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