aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762


import java.io.*;
import java.util.*;

public class C {
	
	static StringBuilder st = new StringBuilder();
	static final int MOD = (int)1e9 + 7 ; 
	
	static int add(int a , int b)
	{
		int c = a + b ; 
		if(c >= MOD)
			c -= MOD ; 
		
		return c ; 
	}
	
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		int ans = 0 , sum = 0 ; 
		
		
		for(char c : sc.next().toCharArray())
			if(c == 'a')
				ans = add(ans, sum + 1);
			else if(c == 'b')
				sum = ans ; 
		
		out.println(ans);
		out.flush();
		out.close();
		
		
	}
	
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String path) throws Exception {
			br = new BufferedReader(new FileReader(path));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

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

	}

	private static  boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private static  void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }

}