aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class TheFairNutAndString {
    static final int MOD = 1000000007;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        long[] dp = new long[str.length()];
        int lastB = 0;
        int sum = 1;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) == 'a') {
                dp[i] += sum;
                dp[i] %= MOD;
            }
            else if (str.charAt(i) == 'b') {
                for (int j = lastB; j < i; j++) {
                    sum += dp[j];
                    sum %= MOD;
                }
                lastB = i;
            }
        }
        int total = 0;
        for (int i = 0; i < dp.length; i++) {
            total += dp[i];
            total %= MOD;
        }
        System.out.println(total);
    }
}
