aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

from sys import stdin,stdout
s=stdin.readline().strip()
arr=[]
marker=0;
for i in range(len(s)):
	if s[i]!='a' and s[i]!='b':
		arr.append(s[marker:i]);
		marker=i+1;
if marker<len(s):
	arr.append(s[marker:])
#print(arr)

def solve(s):
	ans=0
	tctr=0
	for i in s:
		if i=='a':
			tctr+=1
		else:
			if tctr!=0:
				if ans==0:
					ans=tctr+1
				else:
					ans=(ans*(tctr+1))%(10**9 + 7)
			tctr=0
	if tctr!=0:
		if ans==0:
			ans=tctr+1
		else:
			ans=(ans*(tctr+1))%(10**9 + 7)

	return ans-1


finalans=0;
for i in arr:
	finalans+=solve(i)
stdout.write(str(finalans))