aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

public class C {

    public static void main(String[] args) throws IOException {
        new C().solve();
    }

    public BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public StringTokenizer tok = null;

    public String nextToken() throws IOException {
        if (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(reader.readLine());
        }
        return tok.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public void solve() throws IOException {
        String s = nextToken();
        List<Long> aSums = new ArrayList<>();
        long currentASum = 0;
        for (int i = 0; i < s.length(); i++) {
            char symbol = s.charAt(i);
            switch (symbol) {
                case 'a':
                    currentASum++;
                    break;
                case 'b':
                    aSums.add(currentASum);
                    currentASum = 0;
                    break;
            }
        }
        aSums.add(currentASum);

        long answer = aSums.stream()
                .filter(x -> x > 0)
                .map(x -> x + 1)
                .reduce((a, b) -> a * b % 1_000_000_007)
                .orElse(1L);

        if (answer == 0) {
            System.out.println(1_000_000_006);
        } else {
            System.out.println(answer - 1);
        }
    }
}
