aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
t = ""
N = len(s)
pre = "."
MOD = 10 ** 9 + 7
for i in range(N):
    if s[i] == "a":
        t += "a"
        pre = "a"
    elif s[i] == "b" and pre != "b":
        t += "b"
        pre = "b"

q = t.split("b")
num = 1
for i in q:
    num *= len(i) + 1
    num %= MOD

num -= 1
if num < 0:
    num += MOD

print(num)
