#include using namespace std; int n; string s; map, int> mp; int solve(int l, int r) { if (mp[{l, r}] != 0) return mp[{l, r}]; if (l > r) return 0; int ret = 0; string a, b; a = "", b = ""; for (int i = 0; i + l < n / 2; ++i) { a += s[l + i], b = s[r - i] + b; if (a == b) { ret += (solve(l + i + 1, r - i - 1) + 1) % 1000000007; } } return mp[{l, r}] = ret % 1000000007; } int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> s; n = s.size(); auto ans = solve(0, n - 1) + 1; cout << ans << endl; return 0; }