aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#!/usr/bin/env python2
from __future__ import print_function

import os
import sys
from io import BytesIO

sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))

input = lambda: sys.stdin.readline().rstrip('\r\n')
print = lambda x: os.write(1, str(x))
range = xrange

MODF = 1000000007.0
SHRT = 65536.0

MODF_INV = 1.0 / MODF
SHRT_INV = 1.0 / SHRT

fmod = lambda x: x - MODF * int(x * MODF_INV)
fmul = lambda a, b, c=0.0: fmod(fmod(a * SHRT) * int(SHRT_INV * b) + a * (b - SHRT * int(b * SHRT_INV)) + c)


def main():
    s = input().split('b')

    res = 0.0
    for i in range(len(s)):
        a_cnt = s[i].count('a')
        res = fmod(res + fmul(res, a_cnt, a_cnt))

    print(int(res))


if __name__ == '__main__':
    main()
