aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class CString {

    public static final long MOD = (long)Math.pow(10,9) + 7l;

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        String s = scn.next();
        System.out.println(subs(s));
    }

    public static long subs(String s) {
        long sums = 1;

        long t = 1;

        for (char c : s.toCharArray()) {
            if (c == 'a') {
                t += 1;
                t %= MOD;
            }

            if ( c == 'b') {
                if (t > 0) {
                    sums *= t;
                    sums %= MOD;
                    t = 1;
                }
            }
        }

        if (t > 0)
            sums *= t;

        return (sums - 1) % MOD;
    }

}
