// https://atcoder.jp/contests/agc031/tasks/agc031_a

fun main() {
    agc031a()
}

fun agc031a() {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    val BASE_NUM = 1_000_000_007L
    val reveal = s.groupingBy { it }.eachCount()
    val count = reveal.values.map { (it + 1).toLong() }.reduce { acc, i ->
        acc * i % BASE_NUM
    }
    println(count - 1)
}