A = input() B = input() print('YES' if ''.join(sorted(A)) == ''.join(sorted(B)) else 'NO')