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

namespace ConsoleApplication1
{
    class Program
    {
        static long faktorijel(long f)
        {
            if (f == 0)
                return 1;
            else
                return f * faktorijel(f - 1);
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            char[] slova = new char[n+1];
            int[] poj = new int[26];
            int i = 0;
           
            string broj;
            int br;
            long res = 1;
            while (i < n)
            { 
            slova[i] = s[i];
            
            i++;
            }
            i = 0;
            if (n <= 27)
            {
                if (n <= 26)
                {
                    Console.WriteLine("0");
                }
                if (n == 27)
                {
                    Console.WriteLine("2");
                }
            }
            else
            {
                while (i < n)
                {
                    broj = ((int)slova[i]).ToString();
                   
                    br = int.Parse(broj) - 65;
                    poj[br]++;
                    
                   
                    i++;
                }
                i = 0;
                while (i < 26)
                {
                    res = res * (poj[i]) % 1000000007;
                    
                   
                    
                    i++;
                   
                }
                res = res % 1000000007;
               
              
                Console.WriteLine(res);
            }

           // Console.ReadLine();
            
           
            
        }
    }
}