aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File              : c.py
# Author            : recurze
# Date              : 22:32 10.12.2018
# Last Modified Date: 23:13 10.12.2018

s = ''
bs = [0]
index = 0
for i in str(raw_input()):
    if i != 'a' and i != 'b':
        continue
    if i == 'b' and s !='' and s[-1] == 'b':
        continue
    s += i
s = s.split('b')
M = 10**9+7
ans = 1
for i in s:
    ans = (ans * (len(i) + 1))%M
ans -= 1
if ans >= M:
    ans -= M
print ans
