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.*;

public class Main {
    private static void solve(String s) {
        int n = s.length();
        List<Integer> list = new ArrayList<>();
        boolean b= true;
        for (char c : s.toCharArray()) {
            if (c=='a'){
                if (!b){
                    list.set(list.size()-1,list.get(list.size()-1)+1);
                }else{
                    list.add(1);
                    b=false;
                }
            } else if(c=='b'){
                if (!b){
                    b=true;
                }
            }
        }
        int mod = (int)1e9+7;
        long ans=list.isEmpty()?1:list.get(0)+1;
        for (int i = 1; i < list.size(); i++) {
            ans*=(list.get(i)+1);
            ans%=mod;
        }
        //ans+=sum;
        System.out.println(ans-1);
    }


    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        String s = sc.next();
        solve(s);
    }


    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

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

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

        long[] readArrayLong(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }

        int[] readArrayInt(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

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

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