#include #include #include #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; const int MOD = 1e9+7; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; string s; cin >> s; int ans = 0; const int jumps = sqrt(2*n)+1; vector dp(n, vector(jumps, 0)); dp[0][0] = 1; rep(i, n) { if (s[i] == '#') continue; rep(j, n+1) if (j >= jumps) continue; else if (i+1 < n) dp[i+1][j] = (dp[i+1][j] + dp[i][j]) % MOD; else ans = (ans + dp[i][j]) % MOD; rep(j, n) if (j+1 >= jumps) continue; else if (i+j+2 < n) dp[i+j+2][j+1] = (dp[i+j+2][j+1] + dp[i][j]) % MOD; else ans = (ans + dp[i][j]) % MOD; } cout << ans << '\n'; }