aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s=input()

total = 1
a_count = 0
for c in s:
	if c=="a":
		a_count += 1
	elif c=="b" and a_count>0:
		total *= (a_count + 1)
		total %= 10**9+7
		a_count = 0
if a_count > 0:
	total *= (a_count + 1)
	total %= 10**9+7
total -= 1
total %= 10**9+7
print(total)