aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import sys
input = sys.stdin.readline
import math
import copy
import collections
from collections import deque
import heapq
import itertools
from collections import defaultdict
from collections import Counter

s = input().rstrip()
n = len(s)
mod = 10**9+7
dp = [0 for i in range(n)]
for i in range(n):
    if s[i]=='a':
        dp[i]=1
sm = 0
prev = 0
for i in range(n):
    if s[i]=='a':
        dp[i]+=sm
    elif s[i]=='b':
        sm+=prev
        sm%=mod
        prev = 0
    else:
        pass
    dp[i]%=mod
    prev+=dp[i]
    prev%=mod
ans = 0
for i in range(n):
    ans+=dp[i]
    ans%=mod
# print(dp)
print(ans)