a = list(input()).sort() b = list(input()).sort() print('YES' if a == b else 'NO')