aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from functools import reduce
from itertools import groupby

if __name__ == '__main__':
    lim = (10 ** 9) + 7
    gs = [len(list(g)) + 1 for k, g in groupby(filter(lambda o: o in ['a', 'b'], list(input()))) if k == 'a']
    print((reduce(lambda x, y: (x * y) % lim, gs, 1) - 1) % lim)
