aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys, math
from sys import stdin, stdout
rem = 10 ** 9 + 7
inf=10**18
#sys.setrecursionlimit(10 ** 6 + 7)
#from resource import *; setrlimit(RLIMIT_STACK, (RLIM_INFINITY, RLIM_INFINITY))
take = lambda: map(int, stdin.readline().split())
from heapq import heappush, heappop, heapify
from collections import deque
from bisect import *

s=list(raw_input())
b=0
ans=0
n=len(s)
ans=[0 for i in range(n+5)]
fin=0
for i in range(1,n+1):
    c=s[i-1]
    if c=='a':
        ans[i]=(1+ans[b])%rem
        fin+=(ans[i])
        fin%=rem
    elif c=='b':
        ans[i]=ans[i-1]
        b=i
print fin

