print( "YES" if sorted([x for x in input()]) == sorted([x for x in input()]) else "NO")