aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 10;
long long int dp[N][2][2][2];
const long long int MOD = 1e9 + 7;
long long int solve(long long int index, long long int prev, long long int gap,
                    long long int flag, vector<long long int> &indexes) {
  if (index >= indexes.size())
    return flag;
  else if (dp[index][prev][gap][flag] != -1)
    return dp[index][prev][gap][flag] % MOD;
  else if (flag) {
    if (prev) {
      if (indexes[index] - indexes[index - 1] == 1) {
        return dp[index][prev][gap][flag] =
                   solve(index + 1, 0, 0, flag, indexes) % MOD;
      } else {
        long long int yes = solve(index + 1, 1, 0, flag, indexes);
        long long int no = solve(index + 1, 0, 1, flag, indexes);
        return dp[index][prev][gap][flag] = (yes + no) % MOD;
      }
    } else {
      if (gap == 1) {
        long long int yes = solve(index + 1, 1, 0, flag, indexes);
        long long int no = solve(index + 1, 0, gap, flag, indexes);
        return dp[index][prev][gap][flag] = (yes + no) % MOD;
      } else
        return dp[index][prev][gap][flag] =
                   solve(index + 1, 0, gap, flag, indexes) % MOD;
    }
  } else {
    long long int yes = solve(index + 1, 1, 0, 1, indexes);
    long long int no = solve(index + 1, 0, 0, 0, indexes);
    return dp[index][prev][gap][flag] = (yes + no) % MOD;
  }
}
string clean(string s) {
  string ans;
  for (char c : s) {
    if (c == 'a' or c == 'b') ans += c;
  }
  return ans;
}
int main() {
  string str;
  cin >> str;
  str = clean(str);
  memset(dp, -1, sizeof(dp));
  vector<long long int> indexes;
  for (long long int i = 0; i < str.size(); i++) {
    if (str[i] == 'a') indexes.push_back(i);
  }
  cout << solve(0, 0, 0, 0, indexes) % MOD << endl;
}
