aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

def func(s):
	buckets = []
	curr_count = 0
	for char in s:
		if char == 'a':
			curr_count += 1
		elif char == 'b':
			buckets.append(curr_count)
			curr_count = 0
	if curr_count > 0:
		buckets.append(curr_count)
	if buckets == []:
		return 0
	prod = 1
	for b in buckets:
		prod = (prod * (b+1)) % 1000000007
	prod = (prod + 1000000007 - 1) % 1000000007
	return prod

s = raw_input()
print(func(s))