aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762


import heapq,math
from collections import defaultdict,deque

import sys, os.path
#sys.setrecursionlimit(10000000)
if(os.path.exists('C:/Users/Dhanush/Desktop/cp/input.txt')):
    sys.stdout = open('C:/Users/Dhanush/Desktop/cp/output.txt', 'w')
    sys.stdin = open('C:/Users/Dhanush/Desktop/cp/input.txt', 'r')

input=sys.stdin.readline

mod=10**9+7
  
s=input().strip()
n=len(s)
ns=[]
for i in range(n):
    if(s[i]=='a' or s[i]=='b'):
        ns.append(s[i])
s="".join(ns)
n=len(ns)
i=0
l=[]
while(i<n):
    while(i<n and s[i]=='b'):
        i+=1
    cnt=0
    while(i<n and s[i]=='a'):
        i+=1
        cnt+=1
    if(cnt>0):
        l.append(cnt)
#print(l)
if(len(l)==0):
    print(0)
else:
    ans=l[0]+1
    for i in range(1,len(l)):
        ans=(ans*(l[i]+1))%mod
    print(ans-1)
