aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()
MOD = (int)(1e9+7)
cnt = 1
a = list()
for i in range(len(s)):
    if s[i] != 'a' and s[i] != 'b':
        continue
    if s[i] == 'a':
        cnt+=1
    else:
        a.append(cnt)
        cnt = 1
a.append(cnt)
ans = 1
for i in a:
    ans*=i
    ans%=MOD
ans-=1
ans+=MOD
ans%=MOD
print(ans)
