aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

//https://codeforces.com/contest/1084/problem/C
public class FairNutAndString {
    private static long MOD = (long) (Math.pow(10, 9)) + 7L;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.nextLine().toCharArray();
        List<Integer> aCounts = new ArrayList<>();
        aCounts.add(0);
        for (int i = 0; i < s.length; i++) {
            if (s[i] == 'a') {
                aCounts.set(aCounts.size() - 1, aCounts.get(aCounts.size() - 1) + 1);
            } else if (aCounts.get(aCounts.size()-1) != 0 && s[i] == 'b') {
                aCounts.add(0);
            }
        }
        long[][] dp = new long[2][aCounts.size()];
        long sum = 0;
        for (int i = 0; i < dp.length; i++) {
            for (int j = 0; j < dp[0].length; j++) {
                dp[i][j] = 0;
            }
        }
        dp[0][0] = aCounts.get(0);
        for (int i = 1; i < dp[0].length; i++) {
            dp[0][i] = (dp[0][i - 1] + aCounts.get(i)) % MOD;
        }
        sum = dp[0][dp[0].length-1];
        for (int i = 1; i < dp[0].length; i++) {
            for (int j = 1; j < dp[0].length; j++) {
                dp[i%2][j] = (dp[(i - 1)%2][j - 1] * aCounts.get(j) + dp[i%2][j - 1]) % MOD;
            }
            sum = (sum +dp[i%2][dp[0].length-1])%MOD;
        }
        System.out.println(sum);
        sc.close();
    }
}
