aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new PrintStream(System.out));
        char[]arr2=f.readLine().toCharArray();
        char[]arr=new char[110000];
        int n=0;
        for(int i=0;i<arr2.length;i++){
            if(arr2[i]=='a' || arr2[i]=='b'){
                arr[n++]=arr2[i];
            }
        }
        final int MOD=1000000007;
        long[]dp=new long[n];
        long last=0;
        for(int i=0;i<n;i++){
            if(i!=0)
            dp[i]+=dp[i-1];
            if(arr[i]=='a'){
                dp[i]++;
                dp[i]+=last;
                dp[i]%=MOD;
            }
            else{
                if(i!=0 && arr[i-1]!='b')
                last=dp[i-1];
            }
        }
        if(n==0){
            System.out.print(0);
        }
        else
        System.out.println(dp[n-1]);
        f.close();
        out.close();
    }
}
class pair implements Comparable <pair>{
    int num;
    int idx;

    public int compareTo(pair other){
        return num- other.num;
    }


    pair(int a, int b)
    {
        num=a;
        idx=b;
    }
}
