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;
import java.util.StringTokenizer;

public class Main {

    private static final int MOD7 = 1000000007;

    static Reader reader = new Reader();

    public static void main(String[] args) {
        String str = reader.nextLine();
        long multiply = 0;
        int current = 1;
        boolean groupStarted = false;
        for(char c : str.toCharArray()) {
            if(c == 'b') {
                if(groupStarted) {
                    if(multiply == 0) multiply = 1;
                    multiply = modMultiply(multiply, current);
                }
                groupStarted = false;
                current = 1;
            } else if(c == 'a') {
                groupStarted = true;
                current ++;
            }
        }
        if(current > 1) {
            multiply = modMultiply(multiply, current);
        }
        System.out.println(multiply - 1);

    }

    public static long modAdd(long a, long b) {
        return ((a % MOD7) + (b % MOD7)) % MOD7;
    }

    public static long modMultiply(long a, long b) {
        return ((a % MOD7) * (b % MOD7)) % MOD7;
    }

    static class Reader {
        private StringTokenizer st;
        private BufferedReader br;

        Reader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            while(st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {

                }
            }
            return st.nextToken();
        }

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

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

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

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {

            }
            return str;
        }
    }

}
