aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s=list(input())

def poss(arr): 
    n=len(arr)
    ans = 1; 
    for i in range(0,n): 
        ans = ans * (arr[i] + 1) 
    return ans-1
    
cs=[0]
for i in s:
    if i=='a':
        cs[-1]+=1
    elif i=='b' and cs[-1]!=0:
        cs.append(0)

#print(cs)
print(poss(cs)%(10**9+7))