aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Hung Vu
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CTheFairNutAndString solver = new CTheFairNutAndString();
        solver.solve(1, in, out);
        out.close();
    }

    static class CTheFairNutAndString {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int modulo = 1000000007;
            String s = in.next();
            int n = s.length();
            char[] a = s.toCharArray();
            int i = 0;
            boolean b = false;
            int res = 0;
            int prev = 0;
            int now = 0;
            while (i < n) {
                if (a[i] == 'a') {
                    now++;
                    res++;
                    res %= modulo;
                } else {
                    if (b) {
                        res += (prev * now) % modulo;
                        res %= modulo;
                    }
                    prev += now;
                    now = 0;
                    if (prev > 0 && a[i] == 'b')
                        b = true;
                }
                i++;
            }
            if (b) {
                res += (prev * now) % modulo;
                res %= modulo;
            }
            out.println(res);
        }

    }
}

