aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import math


def seq_count(str_):
    prev = None
    base_a = 0
    a_count = 0
    seq_count = 0
    for i in range(len(str_)-1, -1, -1):
        if arr[i] == 'a':
            seq_count += 1
            seq_count += base_a
            a_count += 1
        elif (arr[i] == 'b') and (prev != 'b'):
            base_a = seq_count
            a_count = 0
        prev = arr[i]
    return seq_count % (10 ** 9 + 7)


if __name__ == '__main__':
    arr = input()
    print(seq_count(arr))
