aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from sys import stdin
input=lambda : stdin.readline().strip()
from math import ceil,sqrt,factorial,gcd
from collections import deque
s=input()
l=[0]
for i in range(len(s)):
	if s[i]=='a':
		l[-1]+=1
	elif s[i]=='b':
		if l[-1]!=0:
			l.append(0)
if l[-1]==0:
	l.pop()
if len(l)==0:
	print(0)
else:
	count=1
	mod=pow(10,9)+7
	for i in l:
		count=(count*((1+i)%mod))%mod
	count-=1
	print(count%mod)