aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = raw_input()
a = [0]
for x in s:
    if x == 'a': a[-1] += 1
    if x == 'b' and a[-1] != 0: a.append(0)
if a[-1] == 0: a.pop()

if len(a) == 0: print 0
else:
    c = 0
    o = 10 ** 9 + 7
    for x in a:
        if x == 0: continue
        if c == 0: c = x
        else: c = ((c + x) + (c * x)) % o
    print c
