aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from itertools import groupby
from functools import reduce

s = input().strip()
s = "".join(c for c in s if c in {"a", "b"})
runs = []
for key, grp in groupby(s):
    if key == "a":
        runs.append(len(tuple(grp)))

adj = [l+1 for l in runs]
result = (reduce(lambda x, y: (x*y)%(10**9+7), adj, 1) - 1) % (10**9 + 7)
print(result)