func_code_string: #include <bits/stdc++.h>   using namespace std;   int N, M;   string str[2005];   long long pr[2005][2005], pc[2005][2005];   long long dpr[2005][2005], dpd[2005][2005];   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cin >> N >> M;     for (int i = 0; i <= N - 1; i++) cin >> str[i];     bool has = 0;     for (int i = N - 1; i >= 0; i--) {       for (int j = M - 1; j >= 0; j--) {         pr[i][j] = (i == N - 1) ? 0 : pr[i + 1][j] + (str[i + 1][j] ==  R );         pc[i][j] = (j == M - 1) ? 0 : pc[i][j + 1] + (str[i][j + 1] ==  R );         if (str[i][j] ==  R ) has = 1;       }     }     if (N == 1 || M == 1) {       cout << (has ? 0 : 1) <<   n ;       return 0;     }     long long ans = 0;     for (int i = N - 1; i >= 0; i--) {       for (int j = M - 1; j >= 0; j--) {         if (i == N - 1) {           if (pc[i][j] == 0) dpr[i][j] = 1;           dpr[i][j] = (dpr[i][j] + dpr[i + 1][j]) % 1000000007;         } else if (j == M - 1) {           if (pr[i][j] == 0) dpd[i][j] = 1;           dpd[i][j] = (dpd[i][j] + dpd[i][j + 1]) % 1000000007;         } else {           int c = pc[i][j];           dpr[i][j] = (dpd[i][j + 1] - dpd[i][M - c] + 1000000007) % 1000000007;           c = pr[i][j];           dpd[i][j] = (dpr[i + 1][j] - dpr[N - c][j] + 1000000007) % 1000000007;           if (i == 0 && j == 0) ans = (dpd[0][0] + dpr[0][0]) % 1000000007;           dpr[i][j] = (dpr[i][j] + dpr[i + 1][j]) % 1000000007;           dpd[i][j] = (dpd[i][j] + dpd[i][j + 1]) % 1000000007;         }       }     }     cout << ans <<   n ;     return 0;   }   