aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

'''input
agaa
'''
from sys import stdin
import math


def clean_it(string):
    mystack = []
    for i in range(len(string)):
        if string[i] == 'a' or string[i] == 'b':
            if len(mystack) == 0:
                if string[i] == 'a':
                    mystack.append(string[i])
            elif mystack[-1] == 'a':
                mystack.append(string[i])
            elif mystack[-1] == 'b':
                if string[i] == 'a':
                    mystack.append(string[i])
        
    return mystack
            


# main starts
mod = 10 ** 9 + 7
string = list(stdin.readline().strip())
string = clean_it(string)
dp = [0]* len(string)
dp[0] = 1
multi = 0
for i in range(1, len(string)):
    if string[i - 1] == 'a' and string[i] == 'a':
        dp[i] = (dp[i - 1] + 2 * multi) % mod
        if multi == 0:
        	dp[i] += 1 
    elif string[i - 1] == 'b' and string[i] == 'a':
        dp[i] = (dp[i - 1] * 2 + 1) % mod

    if string[i] == 'b':
    	dp[i] = dp[i -1]    ;multi = dp[i]
print(dp[len(dp) - 1] % mod)
