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;
int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline void read(int *a, int n) {
  for (int i = 0; i < n; i++) a[i] = in();
}
inline void readL(int *a, int n) {
  for (int i = 0; i < n; i++) a[i] = lin();
}
const int maxn = 2e6 + 10;
const int mod = 1e9 + 7;
const int MAX_VAL = 1e18 + 10;
const int MAGIC = 350;
struct eertree {
  int suff_link[maxn], len[maxn], curStringLen, sz,
      preNode = 0, nxt[maxn][26], chain_diff[maxn], prev_chain_link[maxn];
  string T = "";
  inline int doJob(int node) {
    while (T[curStringLen - 2 - len[node]] != T[curStringLen - 1])
      node = suff_link[node];
    return node;
  }
  inline void add_letter(int ch) {
    T += char(ch + 'a');
    curStringLen++;
    preNode = doJob(preNode);
    if (nxt[preNode][ch]) {
      preNode = nxt[preNode][ch];
      return;
    }
    len[sz] = len[preNode] + 2;
    suff_link[sz] = nxt[doJob(suff_link[preNode])][ch];
    chain_diff[sz] = len[sz] - len[suff_link[sz]];
    prev_chain_link[sz] = (chain_diff[sz] == chain_diff[suff_link[sz]])
                              ? prev_chain_link[suff_link[sz]]
                              : suff_link[sz];
    preNode = nxt[preNode][ch] = sz++;
  }
  inline void init() {
    suff_link[0] = 1;
    len[0] = 0;
    len[1] = -1;
    curStringLen = 1;
    T += "!";
    sz = 2;
  }
} et;
int dp_chain[maxn], dp[maxn];
int32_t main() {
  string s;
  cin >> s;
  int n = (int)s.size();
  string t = "";
  for (int i = 0; i < n / 2; i++) {
    t += s[i];
    t += s[n - i - 1];
    ;
  }
  dp[0] = 1;
  et.init();
  for (int i = 1; i <= n; i++) {
    et.add_letter(t[i - 1] - 'a');
    bool fl = i & 1;
    for (int cur = et.preNode; et.len[cur] > 0; cur = et.prev_chain_link[cur]) {
      dp_chain[cur] =
          dp[i - (et.len[et.prev_chain_link[cur]] + et.chain_diff[cur])];
      if (et.chain_diff[cur] == et.chain_diff[et.suff_link[cur]])
        (dp_chain[cur] += dp_chain[et.suff_link[cur]]) %= mod;
      (dp[i] += dp_chain[cur]) %= mod;
    }
    if (fl) dp[i] = 0;
  }
  cout << dp[n] << endl;
}