aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import math

if __name__ == '__main__':

	s = str (input())
	mod = 1000000000+7
	val = 1 
	mult = 1
	ans =  0
	cur = 0  
	prev = 0
	for i in range(len(s)) :
		if s[i]=='a' :
			cur=1
			if val==1 : 
				ans+=1
				val=-1
				continue
			if i!=0 or val==1: 
				mult+=1
				ans += prev%mod + 1
				ans = ans%mod
			else : 
				val=-1
				ans+=1
		if s[i]=='b' :
			if cur==1 and prev == 0 :
				prev =1
			prev = (prev%mod)*(mult)
			prev = prev%mod
			mult = 1



	print(ans%mod)
