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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char s[1000005];
namespace PalindromicAutoMaton {
int trie[1000005][26], len[1000005], fail[1000005], cnt[1000005];
int d[1000005], top[1000005];
int tot, last;
int now;
void Build() {
  tot = 1;
  len[0] = 0;
  fail[0] = 1;
  len[1] = -1;
  fail[1] = 0;
  last = 0;
  now = 0;
}
int New(int l) {
  tot++;
  memset(trie[tot], 0, sizeof(trie[tot]));
  len[tot] = l, fail[tot] = 0;
  return tot;
}
int GetFail(int x) {
  while (s[now - len[x] - 1] != s[now]) x = fail[x];
  return x;
}
void Add(int ch) {
  now++;
  int cur = GetFail(last);
  if (!trie[cur][ch]) {
    int nd = New(len[cur] + 2);
    fail[nd] = trie[GetFail(fail[cur])][ch];
    d[nd] = len[nd] - len[fail[nd]];
    top[nd] = (d[nd] == d[fail[nd]] ? top[fail[nd]] : fail[nd]);
    trie[cur][ch] = nd;
  }
  cnt[trie[cur][ch]]++;
  last = trie[cur][ch];
}
}  // namespace PalindromicAutoMaton
using namespace PalindromicAutoMaton;
char t[1000005];
int sum[1000005];
int dp[1000005];
int main() {
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  int ptr = 0;
  for (int i = 1, j = n; i <= j; i++, j--) {
    s[++ptr] = t[i];
    s[++ptr] = t[j];
  }
  Build();
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    Add(s[i] - 'a');
    for (int p = last; p > 1; p = top[p]) {
      sum[p] = dp[i - len[top[p]] - d[p]];
      if (d[p] == d[fail[p]]) {
        (sum[p] += sum[fail[p]]) %= 1000000007;
      }
      if (i % 2 == 0) (dp[i] += sum[p]) %= 1000000007;
    }
  }
  printf("%d\n", dp[n]);
  return 0;
}