aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.lang.reflect.Array;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public class GFG {

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

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

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

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

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

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

    static  class pair {
        int a,b;
        pair(int a,int b){
            this.a=a;this.b=b;
        }



    }
    static int ct;

    public static void main(String[] args) {
        FastReader s = new FastReader();
        String str=s.next();
        int n=str.length();
        long ct=0;
        ArrayList<Long> li = new ArrayList<>();
        for(int i=0;i<n;i++){
            if(str.charAt(i)=='a'){
                ct++;
            }
            if(str.charAt(i)=='b'){
                li.add(ct);
                ct=0;
            }
        }
        li.add(ct);
        long mod = (long)Math.pow(10,9)+7;
        long ans=0;
        int len=li.size();
        for(int i=0;i<len;i++){
            long num = li.get(i);
            ans =  (num + (ans*num)%mod + ans )%mod;
        }

        System.out.println(ans);

    }
}
