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;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 100;
struct str {
  long long start, delta, count;
  str(long long start1 = 0, long long delta1 = 0, long long count1 = 0)
      : start(start1), delta(delta1), count(count1) {}
  long long end() { return start + delta * (count - 1); }
};
vector<str> g1;
void push(str t) {
  if ((long long)g1.size() == 0 || g1.back().delta != t.delta) {
    g1.push_back(t);
  } else {
    g1.back().count += t.count;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = (long long)s.size();
  string s1;
  for (long long i = 0; i < n / 2; i++) {
    s1 += s[i];
    s1 += s[n - i - 1];
  }
  vector<str> g;
  vector<long long> d(n + 1), cache(n + 1);
  d[0] = 1;
  for (long long i = 0; i < n; i++) {
    long long prev = -i - 1;
    for (auto t : g) {
      if (t.start > 0 && s1[t.start - 1] == s1[i]) {
        t.start--;
        if (prev != t.start - t.delta) {
          push(str(t.start, t.start - prev, 1));
          t.start += t.delta;
          t.count--;
        }
        if (t.count > 0) {
          push(t);
        }
        prev = t.end();
      }
    }
    if (i >= 1 && s1[i - 1] == s1[i]) {
      push(str(i - 1, i - 1 - prev, 1));
    }
    g = move(g1);
    for (auto &t : g) {
      long long add = d[t.end()];
      if (t.count > 1) {
        add += cache[t.start - t.delta];
      }
      add %= mod;
      if (t.start - t.delta >= 0) {
        cache[t.start - t.delta] = add;
      }
      d[i + 1] += add;
      d[i + 1] %= mod;
    }
    g1.clear();
  }
  cout << d[n];
  return 0;
}