aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
from io import BytesIO, IOBase
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,Counter,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('0')

file = 1
def ceil(a,b):
    return (a+b-1)//b




def solve():


    # for _ in range(ii()):
    N = 10001
    invfact = [0]*N
    fact = [1]*N
    for i in range(1,N):
        fact[i] = (fact[i-1]*i)%mod
    invfact[-1] = pow(fact[-1],mod-2,mod)
    for i in range(N-2,-1,-1):
        invfact[i] = ((i+1)*invfact[i+1])%mod

    def nCr(x,y):
        if y > x:
            return 0
        ans = (invfact[x-y]*invfact[y])%mod
        ans *= fact[x]
        ans %= mod
        return ans

    ans = 0
    s = si()
    n = len(s)
    dp = [[0,0] for i in range(n)]
    for i in range(n):
        if i >  0:
            dp[i][0] = dp[i-1][0]
            dp[i][1] = dp[i-1][1]
        if s[i] != 'a' and s[i] != 'b':
            continue
        if s[i]=='a':
            dp[i][0] += dp[i][1]
            dp[i][0] %= mod
            dp[i][0] += 1
            dp[i][0] %= mod
            ans += dp[i][1]
            ans %= mod
            ans += 1
            ans %= mod
        if s[i] == 'b':
            dp[i][1] = dp[i][0]
    print(ans)








    
        








        
if __name__ =="__main__":

    if(file):

        if path.exists('tmp/input.txt'):
            sys.stdin=open('tmp/input.txt', 'r')
            sys.stdout=open('tmp/output.txt','w')
        else:
            input=sys.stdin.readline
    solve()
