#include <bits/stdc++.h>

using namespace std;

int main()
{

    unsigned long long res = 1, i = 0, pok = 0;
    string st, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    cin >> st;

    while (a[pok] != 'Z')
    {
        int nesto = 0;
        while(a[pok] == st[i])
        {
            i++;
            nesto++;
        }
        cout << i << endl;
        //cout << nesto << endl;
        res *= nesto;
        res %= 1000000007;
        nesto = 1;
        pok++;
        while(st[i] != a[pok])
        {
            i++;
            nesto++;
           // cout << nesto;
        }
        res *= nesto;
        res %= 1000000007;
    }
    cout << res;

}