#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <climits>
#include <string>
#include <map>
#include <set>
#include <list>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)

using namespace std;

int i,j,k,l,m,n;
/////////////////////////////////////////////////////
#define mp make_pair
#define MOD (ll)10e9+7

char s[101010];
ll leng;
vector<ll> point[101010];
ll dp[2][101010][2];
ll ref;

int main(){
    scanf("%s",s);
    for(leng=0;s[leng]!='\0';leng++);


    dp[0][0][s[i]-'a']=1;

    for(i=1;i<leng;i++){
        for(j=0;j<i;j++){
            dp[i%2][j][!(s[i]-'a')]+=dp[(i+1)%2][j][s[i]-'a'];
            dp[i%2][j][!(s[i]-'a')]%=MOD;
            dp[i%2][j+1][s[i]-'a']+=dp[(i+1)%2][j][0]+dp[(i+1)%2][j][1];
            dp[i%2][j+1][s[i]-'a']%=MOD;
            dp[(i+1)%2][j][0]=0;
            dp[(i+1)%2][j][1]=0;
            //printf("%lld_%lld ",dp[i%2][j][!(s[i]-'a')],dp[i%2][j+1][s[i]-'a']);
        }
        printf("\n");
    }
    for(i=0;i<leng;i++){
        ref+=dp[(leng+1)%2][i][0]+dp[(leng+1)%2][i][1];
        ref%=MOD;
    }
    printf("%lld",ref);

    return 0;
}