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.List;

public class C {

    private static final long MOD = 1000000007L;

    private void work() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().trim().toCharArray();
        br.close();

        int x = 0;
        while (x < s.length && s[x] != 'a') x++;
        if (x == s.length) {
            System.out.println(0);
            System.exit(0);
        }

        int y = s.length - 1;
        while (s[y] != 'a') y--;

        StringBuilder sb = new StringBuilder();
        int acnt = 0, bcnt = 0;
        for (int i = x; i <= y; i++) {
            switch (s[i]) {
                case 'a':
                    acnt++;
                    sb.append(s[i]);
                    break;
                case 'b':
                    bcnt++;
                    sb.append(s[i]);
                    break;
            }
        }

        if (bcnt == 0) {
            System.out.println(acnt);
            System.exit(0);
        }

        char[] ab = sb.toString().toCharArray();
        List<Long> list = new ArrayList<>();
        int cnt = 0;
        for (char c : ab) {
            switch (c) {
                case 'a':
                    cnt++;
                    break;
                case 'b':
                    if (cnt > 0) list.add((long) cnt);
                    cnt = 0;
                    break;
            }
        }
        if (cnt > 0) list.add((long) cnt);

        long res = acc(0, list);

        System.out.println((res + MOD - 1) % MOD);
    }

    private long acc(int k, List<Long> a) {
        if (k == a.size()) {
            return 1;
        }
        long x = a.get(k);
        return (x + 1) * acc(k + 1, a);
    }

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