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