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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string str = Console.ReadLine();
            bool f = true;
            char [] arr = str.ToCharArray();
            int [] ar = new int [26];
            if(n < 26)
            {
                Console.WriteLine("0");
            }
            else
            {
                if(n == 26)
                {
                    for(int i = 0; i < 26; i++)
                    {
                        int a  = arr[i];
                        if(a != (65 + i))
                        {
                            f = false;
                        }
                    }
                    if(f)
                    {
                        Console.WriteLine("1");
                    }
                    else
                    {
                        Console.WriteLine("0");
                    }
                }
                else
                {
                    int k = 65;
                    int v;
                    for(int i = 0; i < n; i++)
                    {
                        v = arr[i];
                        if(v == k)
                        {
                            ar[k-65]++;
                        }
                        else if(v == k+1)
                        {
                            k++;
                            ar[k-65]++;
                        }
                    }
                    if(k != 90)
                    {
                        Console.WriteLine("0");
                    }
                    else
                    {
                        double d = 1;
                        for(int i = 0; i < 26; i++)
                        {
                            d*=(ar[i]);
                        }
                        double l = Math.Pow(10, 9);
                        l += 7;
                        double dd = d % l;
                        Console.WriteLine(dd);
                    }
                }
            }
            Console.ReadLine();
        }
    }
}