aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class ACMIND {
    static final long MOD = 1_000_000_007, INF = 1_000_000_000_000_000_000L;
    static final int INf = 1_000_000_000;
    static FastReader reader;
    static PrintWriter writer;
    public static void main(String[] args) {
        Thread t = new Thread(null, new O(), "Integer.MAX_VALUE", 100000000);
        t.start();
    }
    static class O implements Runnable {
        public void run() {
            try {
                magic();
            }
            catch (Exception e) {
                e.printStackTrace();
                System.exit(1);
            }
        }
    }
    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

    }
    //variables here
    static void magic() {
        reader = new FastReader();
        writer = new PrintWriter(System.out, true);
        char c[] = reader.next().toCharArray();
        int n = c.length;
        //dp[i] represents no of subsequences starting with index i
        long sum_after_the_last_b_I_saw = 0, current_sum = 0;
        for(int i=n-1;i>=0;--i) {
            if(c[i]!='b' && c[i]!='a') {
                continue;
            }
            if(c[i]=='b') {
                sum_after_the_last_b_I_saw = current_sum;
            }
            else {
                long ispe_start_kitna_hoga = 1 + sum_after_the_last_b_I_saw;
                current_sum = (current_sum + ispe_start_kitna_hoga)%MOD;
            }
        }
        writer.println(current_sum);
    }
}