aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#   In this template you are not required to write code in main

 # Remember you were also a novice when you started,
 # hence never be rude to anyone who wants to learn something
 # Never open a ranklist untill and unless you are done with solving problems, wastes 3/4 minuts
 # Donot treat CP as a placement thing, love it and enjoy it, you will succeed for sure.

import sys
# inf = float("inf")

# abc='abcdefghijklmnopqrstuvwxyz'
# abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod,MOD=1000000007,998244353
# vow=['a','e','i','o','u']
# dx,dy=[-1,1,0,0],[0,0,1,-1]
# sys.setrecursionlimit(10000000)


# from collections import deque, Counter, OrderedDict,defaultdict
# from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
from math import ceil,floor,log,sqrt,factorial,pow,pi,gcd
# from bisect import bisect_left,bisect_right
#import numpy as np

def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

string='z'+input()
if 'a' not in string:
    print(0)
    exit()
n=len(string)
curr=0
mylist=[]
for i in range(1,n):
    if string[i]=='a':
        curr+=1
    elif string[i]=='b':
        if curr>0:
            mylist.append(curr)
            curr=0


if curr>0:
    mylist.append(curr)
    curr=0
ans=1
for i in mylist:
    ans=ans*(i+1)
    ans%=mod
print(ans-1)
