aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = raw_input()
def get_s(s):
    res = ''
    for let in s:
        if let in ['a', 'b']:
            res += let
    return res

s = get_s(s)
res = 0
sumi = 0
next_sumi = 0
mod = 1000000007
for i in range(len(s)):
    if s[i] == 'b':
        sumi += next_sumi
        next_sumi = 0
        continue
    res += sumi + 1
    next_sumi += sumi + 1
    res %= mod
    sumi %= mod
    next_sumi %= mod
print res