aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

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

public class FairNutString1084C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long res = 1;
        int mod = 1000000007;

        int prev_count = 0;
        List<Integer> lis = new ArrayList<>();
        for(int i = 0;i<s.length();i++) {
            char c = s.charAt(i);
            if(c == 'a') {
                prev_count++;
                //res = (res + count + 1)%mod;
            } else if(c == 'b') {
                if(prev_count != 0) {
                    lis.add(prev_count);
                }

                prev_count = 0;
            }
        }
        if(prev_count != 0) {
            lis.add(prev_count);
        }

        for(int i: lis) {
            res = (res * (i+1))%mod;
        }
        res = res - 1;
        //if(res == 0)
        System.out.println(res);

    }
}
