aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

//package Codeforces;
import java.util.*;

public class string01 {
	static char[] s;
	static long[] memo;
	static long mod = 1000000000 + 7;
	static int[] precomp;
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		s = in.next().toCharArray();
		memo = new long[s.length+1];
		Arrays.fill(memo, (long)-1);
		precomp = new int[s.length];
		
		// Precomp
		int prev = s.length;
		for(int i=s.length-1; i>=0; i--) {
			if(s[i] == 'b') {
				precomp[i] = prev;
				prev = i;
			}
			else {
				precomp[i] = prev;
			}
		}
		
		System.out.println(dp(0)-1);
		
	}
	
	static long dp(int idx) {
		if(idx >= s.length)
			return 1;
		if(memo[idx] != -1)
			return memo[idx];
		if(s[idx] != 'a')
			return memo[idx] = dp(idx+1);
		long r = dp(idx+1) + dp(precomp[idx]);
		return memo[idx] = r%mod;
	}
	

}
