aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

MOD = 10**9 + 7

S = input().strip()
N = len(S)

# select a's in groups such that consecutive a's
# without b's in between are grouped together.

groups = [0]
size = 1
for ch in S:
	if ch == 'a':
		groups[size - 1] += 1
	elif ch == 'b':
		groups.append(0)
		size += 1

ans = 1
for ind in range(size - 1, -1, -1):
	ans = (ans * (groups[ind] + 1)) % MOD

print(ans - 1)
