aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import math
import sys



def main():

    s = input()

    a = s.split('b')

    cnt = []

    for i in a:
        sum_ = 0
        for j in i:
            sum_ += (j == 'a')
        if sum_ > 0:
            cnt.append(sum_)

    if len(cnt) == 0:
        print(0)
    else:
        ans = 1

        mod = int(1e9 + 7)

        for i in cnt:
            ans *= (i+1)
            ans %= mod

        print(ans - 1)

if __name__ == '__main__':
    main()

