import algorithm var a, b: string = stdin.readline if sorted(a) == sorted(b): echo "YES" else: echo "NO"