aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys

s = input()

i = 0
n = len(s)
count = 0
p = 1
for i in range(len(s)):
	if (s[i] == 'a'):
		count += 1
	if (s[i] == 'b'):
		p = (p * (count+1)) % 1000000007
		count = 0

p = (p * (count+1)) % 1000000007
sys.stdout.write(str(p-1)+"\n")