import Control.Monad
import Data.List

main = do
    _ <- getLine
    s <- getLine :: IO String
    print $ solve s

comb :: Int -> [a] -> [[a]]
comb 0 xs = [[]]
comb _ [] = []
comb n (x:xs) = [x:y | y <- comb (n-1) xs] ++ comb n xs

solve :: String -> Int 
solve s = (length . join $ [ filter (\x -> length (nub x) == length x) $ comb i s | i <- [1..length s]]) `mod` (10^9 + 7)
