aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from fractions import gcd
from math import factorial, ceil, sqrt, atan2, log, pi, e, asin,acos, cos, sin, floor
from itertools import *
from fractions import Fraction
import string
import copy
import random
import bisect
from decimal import *
from collections import deque
from sys import *
digs = string.digits + string.ascii_letters

def id_generator(size=20, chars=string.digits):
    return ''.join(random.choice(chars) for _ in range(size))
 
def mp():
    return map(int,str(raw_input()).split())

mod=10**9+7

s=str(raw_input())
n=len(s)
ans=s.count('a')
if ans==0:
	print 0
	exit()

l=[]
for i in range(n):
	if s[i]=='a':
		l+=[0]
	elif s[i]=='b':
		l+=[1]

n=len(l)
temp=1
if l[0]==1:
	pre=0
else:
	pre=1
for i in range(1,n):
	if l[i]==0:
		pre+=1
	else:
		temp=temp*(pre+1)
		temp%=mod
		pre=0
temp=temp*(pre+1)
temp%=mod
print temp-1



