A = input() B = input() print(['NO', 'YES'][sorted(A) == sorted(B)])