aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

md = 10**9 + 7

s = input() + 'z'

counter = 0
prev = 'a'
flag = 1
ans = 0

for c in s:
	if c == 'a':
		counter += 1
	elif c != 'a' and prev == 'a':
		if flag:
			ans = (ans*(counter+1)) % md
		ans = (ans + counter) % md
		flag = 1 if c == 'b' else 0
		counter = 0
	elif c == 'b':
		flag = 1
	prev = c

print(ans)