aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class P8 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		try {
			System.out.println(solve(scanner));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static long solve(Scanner scanner) throws IOException {
		String line = scanner.nextLine();
		String cleanLine = line.replaceAll("[^ab]", "");

		List<Integer> indices = getAllIndices(cleanLine);

		long countSequences = 0;
		long countSequencesLastBreak = 0;
		for (int i = 0; i < indices.size(); i++) {
			countSequences++;
			if (i + 1 < indices.size()) {
				if (indices.get(i + 1) > indices.get(i) + 1) {
					countSequencesLastBreak = countSequences;
				}
				countSequences += countSequencesLastBreak;
			}
		}
		return countSequences % 1000000007;

	}

	public static List<Integer> getAllIndices(String line) {
		List<Integer> indices = new ArrayList<>();
		for (int i = 0; i < line.length(); i++) {
			if (line.charAt(i) == 'a') {
				indices.add(i);
			}
		}
		return indices;
	}

}
