aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class _1084C {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    Solver solver = new Solver();
    solver.solve(in, out);
    out.close();
  }

  private static class Solver {
    private void solve(InputReader in, PrintWriter out) {
      String data = in.next();
      List<Integer> summary = new ArrayList<>();
      int counter = 0;
      for (int i = 0; i < data.length(); i++) {
        if (data.charAt(i) == 'a') {
          counter++;
        } else if (data.charAt(i) == 'b') {
          if (counter > 0) {
            summary.add(counter);
            counter = 0;
          }
        }
      }
      if (counter > 0) {
        summary.add(counter);
      }

      long multiply = 1;
      long ans = 0;
      if (summary.size() > 0) {
        ans = summary.get(summary.size() - 1) * -1;
      }
      for (int i = summary.size() - 1; i >= 0; i--) {
        multiply = (multiply * summary.get(i)) % 1000000007;
        ans = (ans + multiply + summary.get(i)) % 1000000007;
      }

      out.println(ans);
    }
  }

  private static class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    private InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    private String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

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

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