Problem: Given a string s, find the number of ways to split s to substrings such that if there are k substrings (p1, p2, p3, ..., pk) in partition, then pi = pk - i + 1 for all i (1 ≤ i ≤ k) and k is even.

Since the number of ways can be large, print it modulo 109 + 7.

Input

The only line of input contains a string s (2 ≤ |s| ≤ 106) of even length consisting of lowercase Latin letters. 

Output

Print one integer, the number of ways of partitioning the string modulo 109 + 7.

Examples

Input

abcdcdab


Output

1

Input

abbababababbab


Output

3

Note

In the first case, the only way to partition the string is ab|cd|cd|ab.

In the second case, the string can be partitioned as ab|b|ab|ab|ab|ab|b|ab or ab|b|abab|abab|b|ab or abbab|ab|ab|abbab.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  T data = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    data = (data << 3) + (data << 1) + ch - '0';
    ch = getchar();
  }
  x = f * data;
}
template <typename T, typename... Args>
inline void read(T &t, Args &...args) {
  read(t);
  read(args...);
}
const int inf = 0x3f3f3f3f;
const double eps = 1e-8;
const int maxn = 1e6 + 9;
const int mod = 1e9 + 7;
char st[maxn], t[maxn];
int anc[maxn], dp[maxn], diff[maxn], val[maxn];
namespace PAM {
int sz, tot, last;
int cnt[maxn], ch[maxn][26], len[maxn], fail[maxn];
char s[maxn];
int newnode(int ln) {
  sz++;
  memset(ch[sz], 0, sizeof(ch[sz]));
  len[sz] = ln;
  fail[sz] = cnt[sz] = 0;
  return sz;
}
void clear() {
  sz = -1;
  last = tot = 0;
  s[tot] = '$';
  newnode(0);
  newnode(-1);
  fail[0] = 1;
}
int getfail(int x) {
  while (s[tot - len[x] - 1] != s[tot]) x = fail[x];
  return x;
}
void insert(char c) {
  s[++tot] = c;
  int now = getfail(last);
  if (!ch[now][c - 'a']) {
    int x = newnode(len[now] + 2);
    fail[x] = ch[getfail(fail[now])][c - 'a'];
    ch[now][c - 'a'] = x;
    diff[x] = len[x] - len[fail[x]];
    anc[x] = (diff[x] == diff[fail[x]] ? anc[fail[x]] : fail[x]);
  }
  last = ch[now][c - 'a'];
  cnt[last]++;
}
};  // namespace PAM
using namespace PAM;
signed main() {
  scanf("%s", st + 1);
  int n = strlen(st + 1), l = 1, r = n;
  for (int i = 1; i <= n; ++i) {
    if (i & 1)
      t[i] = st[l++];
    else
      t[i] = st[r--];
  }
  clear();
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    insert(t[i]);
    for (int j = last; j; j = anc[j]) {
      if (anc[j] != fail[j])
        val[j] = val[fail[j]];
      else
        val[j] = 0;
      int k = i - len[anc[j]] - diff[j];
      val[j] = (val[j] + dp[k]) % mod;
      if (i % 2 == 0) dp[i] = (dp[i] + val[j]) % mod;
    }
  }
  printf("%d\n", dp[n]);
  return 0;
}