#include <bits/stdc++.h>
using namespace std;
clock_t __stt;
inline void TStart() { __stt = clock(); }
inline void TReport() {
  printf("\nTaken Time : %.3lf sec\n",
         (double)(clock() - __stt) / CLOCKS_PER_SEC);
}
template <typename T>
T MIN(T a, T b) {
  return a < b ? a : b;
}
template <typename T>
T MAX(T a, T b) {
  return a > b ? a : b;
}
template <typename T>
T ABS(T a) {
  return a > 0 ? a : (-a);
}
template <typename T>
void UMIN(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
void UMAX(T &a, T b) {
  if (b > a) a = b;
}
int n, ln[100005], cnt, res;
vector<int> dp[100005][2];
char s[100005];
int main() {
  int i, j, k;
  scanf("%s", s);
  n = strlen(s);
  cnt = 1;
  ln[0] = 1;
  for (i = 1; i < n; ++i) {
    if (s[i] == s[i - 1]) {
      ln[cnt] = 1;
      ++cnt;
    } else {
      ++ln[cnt - 1];
    }
  }
  dp[0][0].resize(ln[0] + 1, 0);
  dp[0][1].resize(ln[0] + 1, 0);
  dp[0][s[ln[0] - 1] - 'a'][ln[0]] = 1;
  int ptr = ln[0];
  for (i = 1; i < cnt; ++i) {
    dp[i][0].resize(ln[i] + 2, 0);
    dp[i][1].resize(ln[i] + 2, 0);
    int fs = s[ptr] - 'a', ls = s[ptr + ln[i] - 1] - 'a';
    dp[i][ls][ln[i] + 1] = dp[i - 1][!fs][1];
    int coe = 0;
    for (j = 1; j < (int)dp[i - 1][0].size(); ++j) {
      coe +=
          (long long)dp[i - 1][fs][j] * (long long)((j + 1) / 2) % 1000000007LL;
      coe %= 1000000007LL;
      dp[i][ls][ln[i]] +=
          (long long)dp[i - 1][fs][j] * (long long)(j / 2 + 1) % 1000000007LL;
      dp[i][ls][ln[i]] %= 1000000007LL;
    }
    for (j = ptr; j < ptr + ln[i] - 1; ++j) {
      dp[i][ls][ln[i] + ptr - 1 - j] += coe;
      dp[i][ls][ln[i] + ptr - 1 - j] %= 1000000007LL;
    }
    dp[i][!ls][1] += coe;
    dp[i][!ls][1] %= 1000000007LL;
    ptr += ln[i];
  }
  for (i = 0; i < (int)dp[cnt - 1][0].size(); ++i) {
    res += dp[cnt - 1][0][i];
    res %= 1000000007LL;
    res += dp[cnt - 1][1][i];
    res %= 1000000007LL;
  }
  printf("%d\n", res);
  return 0;
}
