Scanf.scanf "%d %s" (fun n s ->
    let z = 1000000007 in
    let ( *@) a b = (a * b) mod z in

    let hist = Array.make 26 1 in
    String.iter (fun c -> let q = int_of_char c - 97 in hist.(q) <- hist.(q) + 1) s;

    Printf.printf "%d\n" @@ (z - 1 + Array.fold_left ( *@) 1 hist) mod z
)