aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
a_count =[0] *(len(s) + 1)
prev = curr =None
ab_seen = False;
x = 0;
mod = 10**9 + 7;
# never = True;
while x < len(s) and s[x] != 'a':
    x += 1;
if x < len(s):
    curr = 1;
    prev = 0;
else:
    curr  = 0;
x += 1;
new_curr = None;
while x < len(s):
    while x < len(s) and s[x] != 'a':
        if s[x] == 'b':
            ab_seen = True;
            # never = False;
        x += 1;
    if x == len(s):
        break;
    if ab_seen:
        new_curr = curr * 2 + 1;
    else:
        new_curr = 2 * curr - prev ;
    new_curr = new_curr % mod
    # print(prev,curr,x,new_curr)
    ab_seen = False;
    prev = curr;
    curr = new_curr
    x += 1;
print(curr % mod)