aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

mod = int(1e9 + 7)
s = raw_input()
n = len(s)
flag = True

ret = []
for i in range(n):
    if s[i] == 'a':
        ret.append(i)

l1 = len(ret)
dp = [0]*n
dp [ret[0]] = 1
for i in range(l1-1):
    a,b = ret[i],ret[i+1]
    flag = 0
    for j in range(a+1,b):
        if s[j] =='b':
            flag = 1
    dp[b] = dp[a] + flag

ans = 0

bins = [1]*(n+1)
for i in range(n):
    bins[i+1] = (bins[i]*2)%mod

for i in dp:
    if i >0:
        ans = (ans+bins[i-1])%mod
print ans


  		 	 	 	  		 			   		 	 		  	