aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

//package codeforces.contests.round526;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * @author tainic on Nov 28, 2018
 */
public class C {

    //private static final boolean LOCAL = "aurel".equalsIgnoreCase(System.getenv().get("USER"));
    private static final boolean LOCAL = false;

    private static final String TEST =
        "agaa";

    void solve(Scanner in, PrintWriter out) {
        long mod = 1_000_000_007;

        char[] s = in.next().toCharArray();
        long groupSize = 0;
        long ans = 1;
        for (char c : s) {
            if (c == 'a') {
                groupSize++;
            } else if (c == 'b') {
                ans = ans * (groupSize + 1) % mod;
                groupSize = 0;
            }
        }
        ans = (ans * (groupSize + 1)) % mod;
        ans = (ans + mod - 1) % mod;
        out.println(ans);
    }

    //region main
    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedInputStream(!LOCAL ? System.in : new ByteArrayInputStream(TEST.getBytes())));
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out, 2048), false);
        new C().solve(in, out);
        out.close();
    }
    //endregion

    //region imports
    //endregion

}