aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762



//526 - Div 2 - C

import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static long calculate(String s) {
        int l = s.length();
        String s1 = s;
        long result = 1;
        ArrayList<Integer> chunks = new ArrayList<>();
//        for(int i = 0; i < l; i++) {
//            if(s.charAt(i) == 'a' || s.charAt(i) == 'b')
//                s1 += s.charAt(i);
//        }
        l = s1.length();
        int count = 0;
        for(int i = 0; i < l; i++) {
            if(s1.charAt(i) == 'a')
                count ++;
            else if(s1.charAt(i) == 'b' && count != 0) {
                chunks.add(count);
                count = 0;
            }
        }
        if(count != 0)
            chunks.add(count);
        for(int i = 0; i < chunks.size(); i++) {
            result = (result * (chunks.get(i)+1) ) % 1000000007;
        }
        //Subtracting one for empty sequence
        result -= 1;
        return result;
    }

    public static void main(String args[]) throws IOException {
        String s = sc.next();
        long result = calculate(s);
        System.out.println(result);
    }
}
