aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762


mod = 10**9 + 7

s = input()
occurs = [0]

for i in range(len(s)):
    if s[i] == 'a':
        occurs[-1] += 1
    elif s[i] == 'b' and occurs[-1] != 0:
        occurs.append(0)

res = 0
for n in occurs:
    res += (n + res * n) % mod
    res %= mod

print(res)

			   	 					 	   	   	    	 	