class Integer
  def combination(k)
    return 1 if k.zero?

    (self - k + 1..self).inject(:*) / k.factorial
  end

  def factorial
    return 1 if self.zero?

    (1..self).inject(:*)
  end
end

N = gets.to_i
S = gets.chomp
MOD = 10 ** 9 + 7

counter = Hash.new(0)

ans = 0

S.each_char do |s|
  c = 1

  counter.each do |key, v|
    next if key == s

    t = v.combination(1) + 1

    c = (c * t) % MOD
  end

  ans = (ans + c) % MOD
  counter[s] += 1
end

puts ans
