aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

def decompose(string):
	ans = []
	current_a_count = 0
	for c in string:
		if c == 'a':
			current_a_count += 1
		elif c == 'b':
			if current_a_count > 0:
				ans.append(current_a_count)
			current_a_count = 0
	
	if current_a_count > 0:
		ans.append(current_a_count)
	
	return ans

"""
assert decompose("aba") == [1,1]
assert decompose("aaa") == [3]
assert decompose("aabbaa") == [2,2]
assert decompose("ababa") == [1,1,1]
assert decompose("aabbaabbaabb") == [2,2,2]
assert decompose("bbb") == []
"""

def solve(string):
	problem = decompose(string)
	if len(problem) == 0:
		# there are no a's
		return 0 
	
	solutions = 0
	for i in problem:
		solutions += i + solutions * i
	
	return solutions % (10 ** 9 + 7)

string = input()
print(solve(string))
