aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Random;
import java.util.Scanner;

public class Main {

    static long mod = (long) (1E9 + 7);

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        if (s.length() == 0) {
            System.out.println(0);
            return;
        }
        s += 'b';

        int n = s.length();

        long subsec = 0, a = 0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == 'a') {
                a++;
            } else if (s.charAt(i) == 'b') {
                long x = (subsec * a) % mod;
                long y = (subsec + x) % mod;
                long z = (y + a) % mod;
                subsec = z;
                // sunsec = subsec + a * subsec + a;
                a = 0;
            }
        }
        System.out.println(subsec);

    }
}