#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #ifndef LOCAL #define debug(x) ; #else #define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl; template ostream &operator<<(ostream &out, const pair &p) { out << "{" << p.first << ", " << p.second << "}"; return out; } template ostream &operator<<(ostream &out, const vector &v) { out << '{'; for (const T &item : v) out << item << ", "; out << "\b\b}"; return out; } #endif #define mod 1000000007 //1e9+7(prime number) #define INF 1000000000 //1e9 #define LLINF 2000000000000000000LL //2e18 #define SIZE 200010 /* Zalgorithm */ // A[i] := S と S[i:|S|-1] の最長共通接頭辞の長さ void Zalgorithm(const char *S, int *A){ int i = 1, j = 0, k, n = strlen(S); A[0] = n; while (i < n) { while (i+j < n && S[j] == S[i+j]) j++; A[i] = j; if (j == 0) { i++; continue; } for (k = 1; i+k < n && k+A[k] < j; k++) A[i+k] = A[k]; i += k; j -= k; } } ll dp[SIZE]; int a[SIZE]; int main(){ char s[SIZE]; int n; scanf("%s", s); n = strlen(s); dp[0] = 1; for(int i=0;i j) dp[i+j+1] = (dp[i+j+1] + dp[i]) % mod; } ll ans = 0; for(int i=0;i<=n/2;i++) ans += dp[i]; cout << ans % mod << endl; return 0; }