aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

st = input()
for ch in st:
	if (ch != 'a' and ch != 'b'): st = st.replace(ch,'')

if(len(st) == 0):
	print(0); exit(0)

st = [len(seg) for seg in st.split('b') if seg != '']
cum = [0]*len(st)
for i in range(len(cum)):
	cum[i] = st[i] + cum[i-1]*(i!=0)

total, ans = cum[-1], 0
for i in range(len(st)):
	ans+=(st[i]*(total-cum[i]))

print( (ans+sum(st))%(10**9+7)) 