N = gets.chomp!.to_i
S = gets.chomp!
h = Hash.new

for i in 0..N - 1 do
	if !h.key?(S[i]) then
		h[S[i]] = S.count(S[i]) + 1	
	end
end

output = 1
h.each{|key, value|
	output = output * value
}
output = output % 1000000007
output = output - 1
p output
