#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; for (int i = t.size() - 1; i >= 0; i--) { ans++; if (t[i].size() == 1 && i != 0) { ans = ans * 2 - 1; ans %= MOD; } } cout << ans << endl; return 0; }