#include <bits/stdc++.h>
using namespace std;
static const int INF = 10e9 + 7;
typedef struct {
  vector<int> vec;
  int size;
} Node;
int main(void) {
  string S;
  cin >> S;
  vector<int> SF;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == 'a')
      SF.push_back(-1);
    else
      SF.push_back(1);
  }
  Node SE;
  SE.vec = SF;
  SE.size = S.size();
  vector<Node> V;
  V.push_back(SE);
  int g = 0;
  while (V.size() >= g) {
    Node F = V[g];
    g++;
    for (int i = 0; i < F.size - 1; i++) {
      if (F.vec[i] * F.vec[i + 1] > 0) {
        vector<int> IN;
        IN = F.vec;
        IN.erase(IN.begin() + i);
        IN[i] *= -1;
        Node INT;
        INT.vec = IN;
        INT.size = F.size - 1;
        V.push_back(INT);
      }
    }
  }
  vector<vector<int> > ANS;
  for (unsigned int i = 0; i < V.size(); i++) ANS.push_back(V[i].vec);
  sort(ANS.begin(), ANS.end());
  ANS.erase(unique(ANS.begin(), ANS.end()), ANS.end());
  cout << ANS.size() % INF << endl;
  return 0;
}
