aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.*;
import java.util.StringTokenizer;

public class Main {
    private static long MODULO = (int) 1e9 + 7;
    private FastScanner in;
    private PrintWriter out;

    public static void main(String[] args) {
        try {
            (new Main()).run();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    private void run() throws IOException {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);
        char[] s = (in.next() + "b").toCharArray();
        long ans = 1;
        long cur = 0;
        for (int i = 0; i < s.length; i++) {
            if (s[i] == 'a') {
                cur++;
            }
            if (s[i] == 'b') {
                ans *= cur + 1;
                ans %= MODULO;
                cur = 0;
            }
        }
        ans = (ans - 1 + MODULO) % MODULO;
        out.println(ans);
        out.close();
    }


    private class FastScanner {
        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        FastScanner(InputStream inputStream) {
            this.bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }

        FastScanner(File file) throws IOException {
            this.bufferedReader = new BufferedReader(new FileReader(file));
        }

        public String nextLine() throws IOException {
            return bufferedReader.readLine();
        }

        public String next() throws IOException {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                String line = bufferedReader.readLine();
                if (line == null) return null;
                stringTokenizer = new StringTokenizer(line);
            }
            return stringTokenizer.nextToken();
        }

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

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

        public double nextDouble() throws IOException {
            return Double.parseDouble(this.next());
        }

    }
}