aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = str(input())
amount = 1
a_c = 1
last = True

for i in s:
    if i == "a" and last:
        last = False
        a_c = 2
    elif i == "a":
        a_c += 1
    elif i == "b":
        last = True
        amount *= a_c
        a_c = 1

if not last:
    amount *= a_c

print((amount - 1) % (10 ** 9 + 7))


