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.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Washoum
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(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, inputClass sc, PrintWriter out) {
            int mod = (int) (1e9 + 7);
            String ch = sc.nextLine();
            int cnt = 0;
            long[] tab = new long[ch.length()];
            int i = ch.length() - 1;
            while (i >= 0 && ch.charAt(i) != 'a')
                i--;
            if (i < 0) {
                out.println(0);
                return;
            }
            tab[i] = 1;
            int lasta = i;
            i--;

            long sum = 1;
            for (int j = i; j >= 0; j--) {
                if (ch.charAt(j) == 'a') {
                    if (lasta - j == 1) {
                        tab[j] = tab[lasta];
                        sum = (sum + tab[j]) % mod;
                    } else {
                        if (cnt > 0) {
                            tab[j] = (1 + sum) % mod;
                            sum = (sum + tab[j]) % mod;
                        } else {
                            tab[j] = 1;
                            sum = (sum + tab[j]) % mod;
                        }
                    }
                    lasta = j;
                    cnt = 0;
                } else {
                    if (ch.charAt(j) == 'b') {
                        cnt++;
                    }
                }
            }
            long ans = 0;
            for (int j = 0; j < ch.length(); j++) {
                ans = (ans + tab[j]) % mod;
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}

