aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

mod = 1000000007
entrada = input()
res = 1
cnt = 1
resultado = 0

def defMod(x):
  return ((x % mod) + mod) % mod

for i in entrada:
  if i == 'a':
    cnt += 1
  elif i == 'b':
    res = defMod(res * cnt)
    cnt = 1
res = defMod(res * cnt)

resultado = defMod(res-1)

print(resultado)
    			 					  		 	     	 	 	 	