func_code_string: #include <bits/stdc++.h>   using namespace std;   char c[2001][2001];   int sum1[2001][2001], sum2[2001][2001];   int f[2001][2001][2];   int mod = 1000000007;   int main() {     int n, m;     scanf( %d %d , &n, &m);     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         scanf(  %c , &c[i][j]);       }     }     if (n == 1 && m == 1 && c[1][1] ==  . ) {       cout << 1 << endl;       return 0;     }     for (int i = n; i >= 1; i--) {       for (int j = m; j >= 1; j--) {         if (c[i][j] ==  R ) {           sum1[i][j] = sum1[i][j + 1] + 1;           sum2[i][j] = sum2[i + 1][j] + 1;         } else {           sum1[i][j] = sum1[i][j + 1];           sum2[i][j] = sum2[i + 1][j];         }       }     }     for (int i = 1; i < n; i++) {       if (sum2[i][m] == 0) f[i][m][0] = 1;     }     for (int i = 1; i < m; i++) {       if (sum1[n][i] == 0) f[n][i][1] = 1;     }     for (int i = n - 1; i >= 1; i--) {       for (int j = m - 1; j >= 1; j--) {         f[i][j][0] += f[i + 1][j][1];         f[i][j][1] += f[i][j + 1][0];         f[i][j][0] %= mod;         f[i][j][1] %= mod;         if (c[i + 1][j] ==  R ) {           f[i][j][0] +=               (f[i + 1][j][0] - f[n - sum2[i + 1][j] + 1][j][1] + mod) % mod;         } else {           f[i][j][0] += f[i + 1][j][0];         }         if (c[i][j + 1] ==  R ) {           f[i][j][1] +=               (f[i][j + 1][1] - f[i][m - sum1[i][j + 1] + 1][0] + mod) % mod;         } else {           f[i][j][1] += f[i][j + 1][1];         }         f[i][j][0] %= mod;         f[i][j][1] %= mod;       }     }     cout << (f[1][1][0] + f[1][1][1]) % mod << endl;     return 0;   }   