A = sorted(input()) B = sorted(input()) count = 0 for i in range(len(A)): if A[i] in B[i]: count += 1 else: print('NO') break if len(A) == count: print('YES')