using System;
using System.Linq;
using System.Security.Cryptography;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char[] cn = s.ToCharArray();//char niz
            UInt64 x = 1;
            int j = 0;
            UInt32[] brn = new UInt32[26];//br niz
            char t = 'A';//na pocetku nam je potrebno A
            int p = 0;
            while (cn[p] != 'A')
            {
                p++;
            }
            for (int i = p; i < cn.Length; i++)
            {
                if (cn[i] == t)
                {
                    brn[j]++;
                }
                else
                {
                    if (cn[i] == (char)(t + 1))
                    {
                        t = (char)(t + 1);
                        j++;
                        brn[j] = 1;
                    }
                }
            }
            for (int i = 0; i < 26; i++)
            {
                x *= brn[i];
                Console.WriteLine(brn[i]);
            }
            Console.WriteLine(x % 1000000007);
        }
    }
}