aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

u1 = list(input()); n = len(u1)
q = 10 ** 9 + 7
u2 = []
ok = False
for i in range(n):
    if u1[i] == 'a' or u1[i] == 'b':
        u2.append(u1[i])
        if u1[i] == 'a':
            ok = True
    else:
        n -= 1
if not ok:
    print(0)
    exit()
u = [u2[0]]
for i in range(1, n):
    if u2[i] == 'a' or u2[i - 1] == 'a':
        u.append(u2[i])
    else:
        n -= 1
if u[0] == 'b':
    u.pop(0)
    n -= 1
if u[-1] != 'b':
    u.append('b')
    n += 1
x = []
k = 0
for i in range(n):
    if u[i] == 'a':
        k += 1
    else:
        x.append(k + 1)
        k = 0
ans = 1
for i in range(len(x)):
    ans *= x[i]
    ans %= q
print(ans - 1)
