#include #define pb push_back #define mp make_pair #define INF 120000000 #define MOD 1000000007 using namespace std; typedef pair P; typedef long long int LL; int main() { string s; cin >> s; int n = s.size(); vector t; string f = "", b = ""; int l = 0, r = n - 1; while (l < r) { f += s[l]; b = s[r] + b; l++; r--; if (f == b) { t.pb(f); f = ""; b = ""; } } // for (int i = 0; i < t.size(); i++) { // cout << t[i] << endl; // } LL ans = 1; LL cnt = 0; for (int i = t.size() - 1; i >= 0; i--) { if (t[i].size() == 1 && i > 0) { int cnt = 1; int j = i - 1; string tmp = t[i]; while (t[j].size() == 1 && j > 0) { tmp += t[j]; if (tmp.substr(0, tmp.size() / 2) == tmp.substr(tmp.size() / 2 + 1)) cnt++; j--; } ans = ans * (1 + cnt); ans %= MOD; } ans++; } cout << ans % MOD << endl; return 0; }