aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

# @author Nayara Souza
# UFCG - Universidade Federal de Campina Grande
# AA - Basico

mod = 10**9 + 7

s = input()
 
def getMod(x):
  return ((x % mod) + mod) % mod
 
r = 1
count = 1
 
for i in range(len(s)):
  if s[i] == "a":
    count += 1
  elif s[i] == "b":
    r = getMod(r*count)
    count = 1

r = getMod(getMod(r*count)-1)

print(r)

	  					 	 	   	  				 	   	  	