using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Takmicenje2_zad3
{
    class Program
    {
        static void Main(string[] args)
        {
            string n;
            int a, j = 0, br = 0;
            long resenje = 1;
            a = int.Parse(Console.ReadLine());
            n = Console.ReadLine();
            for (char i = 'A'; i <= 'Z'; i++)
            {
                br = 0;
                j = 0;
                while(j < a)
                {
                    if (n[j] > i)
                        break;
                    if(n[j] == i)
                        br++;
                    j++;
                }
                resenje *= br;
            }
            Console.WriteLine("{0}", resenje % 1000000007);
            Console.ReadLine();
        }
    }
}