aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

mod = 10**9 + 7
s = list(input())
sa = []
i = 0
# ans = s.count('a')
# k = ans
cnt = 0
for i in s:
    if i=='a' or i=='b':
        sa.append(i)
s = ''.join(sa)


i = 0
l = []
while i<len(s):


    j = i
    while s[j] == 'a':
        cnt+=1
        j+=1
        if j == len(s):
            break

    if j == len(s):
        l.append(cnt)
    if j == len(s):
        break
    # print(s[j])
    if s[j] != 'a':
        i = j+1
        if s[j] == 'b':
         l.append(cnt)
         cnt = 0

    else:
        i = j

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

print(ans%mod-1)


