aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
news = ''
for c in s:
    if c in ['a','b']:
        news+=c
news += '#a'
i = 0

while news[i] != 'a':
    i+=1
tot = 1
a,b = 'a','b'
while i < len(news)-2:
    count = 0
    while a == news[i]:
        count += 1
        i += 1
    if a == 'a':
        tot*=count+1
        tot%=10**9+7
    a,b = b,a

print(tot-1)
