aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

array=list(input())
MOD=10**9+7
counter=0
numberofa=0
array=array[::-1]
lastA=0
beforeB=0
for i in range(len(array)):
	if array[i]=='a':
		lastA=i


array=array[:lastA+1]
for i in array:
	if i=='a':
		counter+=1
		numberofa+=1
		counter+=beforeB
	if i=='b':
		beforeB=numberofa
print(counter%MOD)