aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
lengths = []
cnt = 0
for c in s:
    if c == 'b':
        lengths.append(cnt)
        cnt = 0
    elif c == 'a':
        cnt += 1
if cnt > 0:
    lengths.append(cnt)
    cnt = 0
if lengths:
    ans = 1
    for l in lengths:
        ans *= (l + 1)
        ans %= (10e9 + 7)
    ans -= 1
    print(int(ans % (int(10e9) + 7)))
else:
    print(0)