#include using namespace std; using ll = long long; const ll MOD = 1000000007; string s; int n; ll dp[10005]; int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> s; n = s.length(); dp[(n - 1) / 2] = 1; if (n % 2 == 0) dp[(n - 1) / 2] += (s[(n - 1) / 2] == s[(n - 1) / 2 + 1]); for (int i = (n - 1) / 2 - 1; i >= 0; i--) { dp[i] = 1; string sl = "", sr = ""; for (int j = i + 1; j <= (n - 1) / 2; j++) { sl += s[j - 1]; sr = s[n - j] + sr; if (sl == sr) (dp[i] += dp[j]) %= MOD; } if (n % 2 == 0) { sl += s[(n - 1) / 2]; sr = s[(n - 1) / 2 + 1] + sr; if (sl == sr) (dp[i] += 1) %= MOD; } } cout << dp[0] << endl; return 0; }