using System;

namespace ConsoleApp1
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            if (n <=26) Console.WriteLine(0);
            else if (n == 27) Console.WriteLine(1);
            else
            {
                int[] a = new int[26];
                int k = 0;
                for (int i = 0; i <= n - 2; i++)
                {
                    a[i - k]++;
                    if (s[i] == s[i + 1]) k++;
                }
                if (s[n - 1] == s[n - 2]) a[25]++;
                double br = 1;
                for (int i = 0; i < 26; i++)
                {
                    br *= a[i];
                }
                br = br % (1000000000+7);
                Console.WriteLine(br);
            }
        }
    }
}