A = input() B = input() print(list(A).sort() == list(B).sort())