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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class C {

    void solve() {
        char[] s = next().toCharArray();
        List<Integer> list = new ArrayList<>();
        int cnt = 0;
        for (int i = 0; i < s.length; i++) {
            if (s[i] == 'a') cnt++;
            else if (s[i] == 'b') {
                if (cnt > 0) {
                    list.add(cnt);
                    cnt = 0;
                }
            }
        }
        if (cnt > 0) list.add(cnt);
        long mod = (long) (1e9 + 7);
        long ans = 0;
        if (list.size() > 1) {
            ans = list.get(0);
            for (int i = 1; i < list.size(); i++)
                ans = (ans * (long) list.get(i)) % mod;
        }
        for (int i = 0; i < list.size(); i++)
            ans = (ans + (long) list.get(i)) % mod;
        System.out.println(ans);
    }

    void init() {
        br = new BufferedReader(new InputStreamReader(System.in));
        solve();
        try {
            br.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    BufferedReader br;
    StringTokenizer st;

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return st.nextToken();
    }

    Integer nextInt() {
        return Integer.parseInt(next());
    }

    Long nextLong() {
        return Long.parseLong(next());
    }

    Double nextDouble() {
        return Double.parseDouble(next());
    }

    public static void main(String[] args) {
        new C().init();
    }
}