aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created by timur on 28.03.15.
 */

public class TaskC {
    boolean eof;
    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    public static void main(String[] args) throws IOException {
        new TaskC().run();
    }

    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return "-1";
            }
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }


    void run() throws IOException {
        InputStream input = System.in;
        PrintStream output = System.out;
        try {
            File f = new File("a.in");
            if (f.exists() && f.canRead()) {
                input = new FileInputStream(f);
                output = new PrintStream("a.out");
            }
        } catch (Throwable e) {
        }
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        solve();
        br.close();
        out.close();
    }

    void solve() {
        long ca = 0;
        long mod = 1_000_000_007;
        String s = nextToken();
        int n = s.length();
        long[] a = new long[n];
        long[] ab = new long[n];

        if (s.charAt(0) == 'a') {
            a[0] = 1;
        }

        for (int i = 1; i < n; i++) {
            if (s.charAt(i) == 'b') {
                ab[i] = (a[i - 1] + ab[i - 1]) % mod;
                a[i] = 0;
            } else if (s.charAt(i) == 'a') {
                a[i] = (a[i - 1] + ab[i - 1]) % mod;
                a[i] = (a[i] + 1) % mod;
                ab[i] = ab[i - 1];
            } else {
                a[i] = a[i - 1];
                ab[i] = ab[ i - 1];
            }
        }
//        for (int i = 0; i < n; i++) {
//            out.print(a[i] + " ");
//        }
//        out.println();
//        for (int i = 0; i < n; i++) {
//            out.print(ab[i] + " ");
//        }
        out.println((a[n - 1] + ab[n - 1]) % mod);
    }
}