aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

mod = 1000000007

def treat(num):
    return ((num%mod) + mod) % mod

seq = input()
cont = 1
saida = 1

for i in seq:
    if(i == "a"):
        cont += 1
    elif(i == "b"):
        saida = treat(saida * cont)
        cont = 1

saida = treat(saida * cont)
print(treat(saida-1))
	     	 	 										   	  		 	