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)
if len(ret) == 0:
    print 0
    exit()
l1 = len(ret)
dp = [0]*n
dp [ret[0]] = 1
psum = 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
    if flag:
        dp[b] = 1+psum
    else:
        dp[b] = dp[a]
    psum = (psum+dp[b])%mod
ans = 0
for i in dp:
    ans = (ans+i)%mod
print ans

	     			 			 	   	  			  		