x = sorted(input()) y = sorted(input()) print('YES' if x == y else 'NO')