aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

//package codeforces.div2;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class TheFairNutAndString {

    static public void print(String s) {

        List<Integer> list = new ArrayList<>();
        int count = 0;
        int i = 0;
        while ( i < s.length()) {
            if(s.charAt(i) == 'a') {
                count++;
                i++;
            } else {
                if(s.charAt(i) == 'b') {
                    if(count!=0) {
                        list.add(count);
                    }
                    while (i < s.length() && s.charAt(i) == 'b') {
                        i++;
                    }
                    count = 0;
                } else {
                    i++;
                }
            }
        }
        if(count!=0) {
            list.add(count);
        }

        int totalCount = 0;

        long pref = 1;
        boolean flag = false;

        if(list.size() == 0) {
            System.out.println(0);
        } else {
            if (list.size() == 1) {
                System.out.println(list.get(0));
            } else {
                for (i = 0; i < list.size(); i++) {
                    pref = (pref * (list.get(i) + 1) );
                }
                pref = pref - 1;
                pref = pref % 1000000007;
                System.out.println(pref);
            }
        }
    }

    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        print(s);
    }
}
