#include #include using namespace std; using namespace atcoder; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; using mint = modint1000000007; //using mint = modint998244353; bool visited[10005][2][100][2]; mint dp[10005][2][100][2]; string S; mint solve(int i, int lz, int m, int smaller){ if(visited[i][lz][m][smaller]) return dp[i][lz][m][smaller]; mint ret(0); int x = 0; if(i> S; int N = S.size(); reverse(ALLOF(S)); cout << solve(N, 1, 0, 0).val() << endl; return 0; }