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 Main {
	private InputStream is;
	private PrintWriter pw;
	static char[][] ch;
	static int x1, x2, y1, y2, n, m, h, k;
	static long dist[][];
	static boolean boo[][];

	void soln() {
		is = System.in;
		pw = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		pw.close();
		pw.flush();
		// tr(System.currentTimeMillis() - s + "ms");
	}

	public static void main(String[] args) throws Exception {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					// new CODEFORCES().soln();
				} catch (Exception e) {
					System.out.println(e);
				}
			}
		}, "1", 1 << 26).start();
		new Main().soln();
	}

	long MOD = (1000000007);

	void solve() {
		char ch[] = ns().toCharArray();
		ArrayList<Integer> amp = new ArrayList<>();
		int cnt = 0;
		for(char c : ch) {
			if(c == 'b') {
				if(cnt!=0) {
					amp.add(cnt);
				}
				cnt = 0;
			}
			else if(c == 'a') {
				cnt++;
			}
		}
		if(cnt!=0) {
			amp.add(cnt);
		}
		//System.out.println(amp);
		if(amp.size()==0) {
			System.out.println(0);
		}
		else if(amp.size()==1) {
			System.out.println(amp.get(0));
		}
		else {
			long val = 1;
			for(int i : amp) {
				val *= (i+1);
				val %= MOD;
			}
			val -= 1;
			val += MOD;
			val %= MOD;
			System.out.println(val);
		}
	}

	long pow(long x, long y, long MOD) {
		long ans = 1;
		while (y > 0) {
			if (y % 2 == 0) {
				x *= x;
				x %= MOD;
				y /= 2;
			} else {
				ans *= x;
				ans %= MOD;
				y -= 1;
			}
		}
		return ans;
	}

	long gcd(long arr, long b) {
		if (b == 0)
			return arr;
		return gcd(b, arr % b);
	}

	void printArray(long[] arr) {
		for (long i : arr)
			pw.print(i + " ");
		pw.println();
	}

	static long min(long x, long y) {
		return (x < y) ? x : y;
	}

	static class Pair implements Comparable<Pair> {
		int x, y;
		int i;

		Pair(int arr, int b) {
			x = arr;
			y = b;
		}

		public int compareTo(Pair p) {
			return Long.compare(this.x % m, p.x % m);
		}

		public String toString() {
			return this.x + " " + this.y;
		}
	}

	 private void method(TreeMap<Integer, TreeSet<Integer>> treeMap, int x, int y, int m, SegmentTree tree, int i, int n) {
	        int l = Math.max(i-m+1, 0);
	        TreeSet<Integer> set = treeMap.get(x);
	        set.remove(i);
	        Integer start1 = set.floor(i);
	        Integer end1 = set.ceiling(i);
	        if(start1 == null)
	            start1 = -1;
	        if(end1 == null)
	            end1 = n;
	        start1++;
	        end1--;
	        l = Math.max(l, start1);
	        int r = Math.min(i, end1-m+1);
	        tree.update(l, r, -1, 0, 0, n-1);
	        if(set.size() == 0)
	            treeMap.remove(x);
	        l = Math.max(i-m+1, 0);
	        if(treeMap.containsKey(y))
	            set = treeMap.get(y);
	        else {
	            set = new TreeSet<>();
	            treeMap.put(y, set);
	        }
	        start1 = set.floor(i);
	        end1 = set.ceiling(i);
	        if(start1 == null)
	            start1 = -1;
	        if(end1 == null)
	            end1 = n;
	        start1++;
	        end1--;
	        l = Math.max(l, start1);
	        r = Math.min(i, end1-m+1);
	        tree.update(l, r, 1, 0, 0, n-1);
	        set.add(i);
	    }
	 
	private static class Queue {
		int l = 0;
		int r = 0;
		Pair[] arr;

		public Queue(int len) {
			arr = new Pair[len];
		}

		public boolean isEmpty() {
			return l == r;
		}

		public void add(Pair x) {
			arr[r++] = x;
		}

		public Pair poll() {
			return arr[l++];
		}

		public void clear() {
			l = r = 0;
		}
	}
	/*
	 * void bfs(int k) { while(!queries.isEmpty()) { int y = queries.poll();
	 * for(long i : amp[y]) { if(!b[i]) { D[i][k] = D[y][k]+1; queries.add(i); b[i]
	 * = true; } } } }
	 */
	/*
	 * int dfs(int x) { b[x] = true; //start[x] = time++; int ans = 1; for(int i :
	 * amp[x]) { if(!b[i]) { ans += dfs(i); } } //end[x] = time; if(x!= 0 &&
	 * ans%2==0 && (N-ans)%2==0) cost++;
	 * 
	 * return ans; }
	 */

	/*
	 * void buildGraph(int n) { for (int i = 0; i < n; i++) { int x1 = ni() - 1, y1
	 * = ni() - 1; amp[x1].add(y1); amp[y1].add(x1); } }
	 */
	public static int[] shuffle(int[] arr, Random gen) {
		for (int i = 0, n = arr.length; i < n; i++) {
			int ind = gen.nextInt(n - i) + i;
			int d = arr[i];
			arr[i] = arr[ind];
			arr[ind] = d;
		}
		return arr;
	}

	public class SegmentTree {
		private long[] tree;
		private long[] base;
		private long[] lazyTree;
		private int size;
		private int n;

		public SegmentTree(int n, long[] arr) {
			this.base = arr;
			int x = (int) (Math.ceil(Math.log(n) / Math.log(2)));
			size = 2 * (int) Math.pow(2, x) - 1;
			tree = new long[size];
			lazyTree = new long[size];
			this.n = n;
			build(0, 0, n - 1);
		}

		public void build(int id, int l, int r) {
			if (l == r) {
				tree[id] = base[l];
				return;
			}
			int mid = ((l + r) >> 1);
			build((id << 1) | 1, l, mid);
			build((id << 1) + 2, mid + 1, r);
			tree[id] = Math.max(tree[(id << 1) | 1], tree[(id << 1) + 2]);
		}

		private long query(int x, int y, int id, int l, int r) {
			if (l > y || x > r)
				return 0;
			if (x <= l && r <= y) {
				return tree[id];
			}
			int mid = ((l + r) >> 1);
			shift(id);
			long q1 = query(x, y, (id << 1) | 1, l, mid);
			long q2 = query(x, y, (id << 1) + 2, mid + 1, r);
			return Math.max(q1, q2);
		}
		private void update(int x, int y, long colour, int id, int l, int r) {
			// System.out.println(l+" "+r+" "+x);
			if (x > r || y < l)
				return;
			if (x <= l && r <= y) {
				tree[id] += colour;
				lazyTree[id] += colour;
				return;
			}
			int mid = ((l + r) >> 1);
			shift(id);
			if (y <= mid)
				update(x, y, colour, (id << 1) | 1, l, mid);
			else if (x > mid)
				update(x, y, colour, (id << 1) + 2, mid + 1, r);
			else {
				update(x, y, colour, (id << 1) | 1, l, mid);
				update(x, y, colour, (id << 1) + 2, mid + 1, r);
			}
			tree[id] = Math.max(tree[(id << 1) | 1], tree[(id << 1) + 2]);
		}

		private void shift(int id) {
			if (lazyTree[id] != 0) {
				tree[(id << 1) | 1] += lazyTree[id];
				lazyTree[(id << 1) | 1] += lazyTree[id];
				tree[(id << 1) + 2] += lazyTree[id];
				lazyTree[(id << 1) + 2] += lazyTree[id];
				lazyTree[id] = 0;
			}
		}
	}

	// To Get Input
	// Some Buffer Methods
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	private double nd() {
		return Double.parseDouble(ns());
	}

	private char nc() {
		return (char) skip();
	}

	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '
									// ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m) {
		char[][] treeMap = new char[n][];
		for (int i = 0; i < n; i++)
			treeMap[i] = ns(m);
		return treeMap;
	}

	private int[] na(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++)
			arr[i] = ni();
		return arr;
	}

	private int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o) {
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}
}