#include #include #include using namespace std; #define MOD (int)(1e9 + 7) typedef long long ll; int memo[1000][1000]; int solve(string s, int k) { ll ret = 1, n = s.length(); if(memo[k][n] != -1) return memo[k][n]; for(int i = 1; i <= n / 2; i++){ if(s.substr(0, i) == s.substr(n - i, i)){ ret += solve(s.substr(i, n - 2 * i), k + i); ret %= MOD; } } return memo[k][n] = ret; } int main() { string s; cin >> s; memset(memo, -1, sizeof(memo)); cout << solve(s, 1) << endl; return 0; }