aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
import javafx.util.*;

public class Solution {
    static class com implements Comparator<Pair<Integer,Integer>>{
        public int compare(Pair<Integer,Integer> a,Pair<Integer,Integer> b){
            int x=a.getKey();
            int y=b.getKey();
            return x-y;
        }
    }
   
    public static void main(String[] args) throws IOException {
      Scanner sc=new Scanner(System.in);
        String s=new String();
        s=sc.next();
        char c[]=s.toCharArray();
        ArrayList<Long> l=new ArrayList<Long> ();
       int len=s.length();
       long count=0;
        for(int i=0;i<len;i++){
            if(c[i]=='a'){
                count++;
            }
            if(c[i]=='b'){
                if(count!=0){
                    l.add(count);
                    count=0;
                }
            }
        }
        if(count!=0){
            l.add(count);
        }
        int x=l.size();
        if(x==0){
            System.out.println(0);
            return ;
        }
       // System.out.println(l.size());
        long dp[]=new long [x];
        long p=1000000007;
        dp[0]=l.get(0);
        for(int i=1;i<x;i++){
            dp[i]=(dp[i-1]+l.get(i)+(l.get(i)*dp[i-1])%p)%p;
        }
        System.out.println(dp[x-1]);
    }
}
