aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input() 
size, mod, res, i = len(s), 1000000007, 1, 0
while i < size:
  j, aux = i, 1
  while j < size:
    if s[j] == 'a':
      aux += 1
      j += 1
    elif s[j] == 'b':
      break
    else:
      j += 1
  i, res = j, res * aux % mod
  i += 1
print(res-1)

	 	    		 	 		 		   			  	  		