aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys

mod=1000000007
s=str(raw_input())
pos=1
n=len(s)

lagataara=1

p=[]

for i in xrange(0,n):
	if s[i]=='a':
		lagataara=lagataara+1
	if s[i]=='b':
		pos=(pos*lagataara)%mod
		lagataara=1
pos=(pos*lagataara+mod)%mod
print(pos-1)