#include <iostream>
#include <string>
using namespace std;
int main()
{
    string str;
    int i=0,j, br[26];
    long long p=1;
    cin>>str;
    for (j=0;j<26;j++)
        br[j]=1;
    while (i<str.length()-1)
       {
        while (str[i]==str[i+1])
           {
               br[str[i]-'A']++;
               i++;
           }
           i++;
       }
    for (j=0;j<26;j++)
        p*=br[j];
    cout<<p%1000000007;
    return 0;
}