MOD = 10**9 + 7

def fact(n)
  @memo ||= []
  @memo[n] ||= (n==0) ? 1 : (n * fact(n-1)) % MOD;
end

def modpow(x,n)
  ret = 1
  while n > 0
    ret = (ret * x) % MOD if n&1 == 1
    x = (x*x) % MOD
    n >>= 1
  end
  return ret
end

def combin(n,k)
  return (((fact(n) * modpow(fact(n-k),MOD-2)) % MOD) * modpow(fact(k),MOD-2)) % MOD
end

N = gets.to_i
s = gets.chomp
cnt = {}

N.times do |i|
  c = s[i]
  if cnt[c].nil?
    cnt[c] = 0
  end
  cnt[c] += 1
end

pair = 0
cnt.each {|k,v|
  pair += v*(v-1)/2
}
ans = N
2.upto(cnt.length) do |i|
  ans += combin(N,i)-pair*combin(N-2,i-2)
  ans %= MOD
end
p ans