aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

s = input()

left = 0
middle = 0
total = 0

modulo = 1000000007

aaa = False

for i in s:
  if(i == 'a'):
    middle += 1
    total = (total + left + 1) % modulo
    aaa = True
  elif(i == 'b'):
    if(aaa):
      aaa = False
      left = (left + middle) % modulo
      middle = 0

print(total % modulo)