#include <bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long res = 1, nesto = 1, i = 0;
    string st;
    cin >> st;

    while (i < st.size())
    {
        if (st[i] == st[++i]) nesto++;
        else
        {
            res *= nesto % 1000000007;
            nesto = 1;
        }

    }
    cout << res;
}