aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def main():
    s=stdin.readline().replace('\n',"")
    n=len(s)
    nb=1
    res=1
    mod=(10**9)+7
    for c in s:
        if (c=='a'):
            res=(res+nb) % mod
        if (c=='b'):
            nb=res 
    stdout.write(str((res+mod-1) % mod))
    return 0
if __name__ == "__main__":
    main()