aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
using namespace std;
string a;
__int64 summ;
int t;
int b[10000];
int  ac(int n,int m)
{
	int i,su;
	if(n==0)
	{
		su=0;
		for(i=m;i<t;i++)
		{
			su+=b[i];
			while(su>=1000000007)
			{
				su-=1000000007;
			}
		}
		return su;
	}
	else
	{
		su=0;
		for(i=m;i<=t-n-1;i++)
		{
			su+=ac(n-1,i+1);
			while(su>=1000000007)
			{
				su-=1000000007;
			}
		}
		return su;
	}
}
int main()
{
	int i,n,j,m;
	while(cin>>a)
	{
		n=a.size ();
		m=0;t=0;
		for(i=0;i<n;i++)
		{
			if(a[i]=='a')
			{
				m++;
				summ++;
			}
			else if(a[i]=='b'&&m!=0)
			{
				b[t]=m;
				t++;
				m=0;
			}
		}
		if(m!=0)
		{
			b[t]=m;
			t++;
		}
		__int64 u;
		u=0;
		for(i=0;i<t;i++)
		{
			u+=ac(i,0);
			while(u>=1000000007)
			{
				u-=1000000007;
			}
		}
		printf("%d\n",u);
	}	
	
	return 0;
}