using System;

namespace Slova
{
    class Program
    {
        static void Main(string[] args)
        {
            int brojSlova;
            do
            {
                brojSlova = int.Parse(Console.ReadLine());
            } while ((brojSlova < 1) || (brojSlova > 1000000));

            string rec;
            do
            {
                rec = Console.ReadLine();
            } while (rec.Length != brojSlova);

            rec.ToUpper();
            char temporary;
            char[] Slova = rec.ToCharArray();
            for (int i = 1; i < Slova.Length; i++)
            {
                for (int j = 0; j < Slova.Length - 1; j++)
                {
                    if (Slova[j] > Slova[j + 1])
                    {
                        temporary = Slova[j];
                        Slova[j] = Slova[j + 1];
                        Slova[j + 1] = temporary;
                    }
                }
            }
            int n = brojSlova;
            if (n <= 26)
                goto label1;
            for (int i = 1; i < Slova.Length; i++)
            {
                for (int j = 0; j < Slova.Length - 1; j++)
                {
                    if (n == 26)
                        goto label2;
                    else if(Slova[j]==Slova[j+1])
                    { 
                        for(int c = j; c<Slova.Length-2; c++)
                        {
                            Slova[j + 1] = Slova[j + 2];
                            n--;
                        }
                        
                    }    

                   
                }
            }

        label1:
        label2:
            int k = 1;
            for (int i = 0; i < 26; i++)
                k *= Slova[i];
            int b = (int)((Math.Pow(10, 9) + 7) % k);
            Console.WriteLine(b);
        }
    }
}