aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

mod=10**9+7
def _mp():
	return map(int,raw_input().split())
s=raw_input()
res=[]
n=len(s)
c=1
for i in range(n):
	if s[i]=='a':
		c+=1
	if s[i]=='b':
		res.append(c)
		c=1
if c>1:
	res.append(c)
ans=1
for i in res:
	ans*=i
ans-=1
print ans%mod