aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

//package r526div2;

import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class C {
    public InputStream in = System.in;
    public PrintStream out = System.out;

    private Scanner scan;

    int n;
    String s;
    int [] aGroup;

    void p(Object value) {
        out.print(value);
    }
    void pln(Object value) {
        out.println(value);
    }

    C() {
        scan = new Scanner(in);
    }

    public C redirectIO(InputStream in, PrintStream out) {
        this.in = in;
        this.out = out;
        scan = new Scanner(in);
        return this;
    }

    public static long test(InputStream inBuffer, PrintStream outBuffer){
        C task = new C().redirectIO(inBuffer, outBuffer);
        long from = System.nanoTime();
        task.run();
        return System.nanoTime() - from;
    }

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

    void run(){

        s = scan.next();
        n = s.length();
        aGroup = new int[n];

        char []c = s.toCharArray();
        int k;
        // skip not 'a'
        for (k = 0; k < n; k++)
            if (c[k] == 'a')
                break;

        int m = 0;
        boolean skip = false;
        for (int i = k; i < n; i++){
            if (c[i] == 'a'){
                aGroup[m] ++;
                skip = false;
            }
            else{
                if (!skip && c[i] == 'b'){
                    m++;
                    skip = true;
                }
            }
        }
        if (!skip) // last 'a'
            m++;

        long s = 1;
        long mod = 1000 * 1000 * 1000 + 7;

        for (int j = 0; j < m; j++){
            s = (s * aGroup[j]) % mod;
            s ++;
        }
        for (int j = 0; j < m - 1; j++){
            s = (s + aGroup[j]) % mod;
        }
        s --;

        p(s);
    }
}

