func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2000 + 7, Mod = 1000000000 + 7;   inline int Inc(int A, int B) {     A += B;     return A >= Mod ? A - Mod : A;   }   inline int Dec(int A, int B) {     A -= B;     return A < 0 ? A + Mod : A;   }   int n, m, A, B, Dpd[N][N], Dpr[N][N], Sumd[N][N], Sumr[N][N], d[N][N], r[N][N];   char Map[N][N];   int main() {     scanf( %d%d , &n, &m);     for (int i = (1), iLimit = (n); i <= iLimit; (++(i)))       for (int j = (1), jLimit = (m); j <= jLimit; (++(j))) cin >> Map[i][j];     if (n == 1 && m == 1) {       if (Map[1][1] ==  R )         puts( 0 );       else         puts( 1 );       return 0;     }     for (int i = (n), iLimit = (1); i >= iLimit; (--(i)))       for (int j = (m), jLimit = (1); j >= jLimit; (--(j))) {         d[i][j] = d[i + 1][j] + (Map[i + 1][j] ==  R );         r[i][j] = r[i][j + 1] + (Map[i][j + 1] ==  R );       }     Dpd[n][m] = Dpr[n][m] = Sumd[n][m] = Sumr[n][m] = (Map[n][m] !=  R );     for (int i = (n), iLimit = (1); i >= iLimit; (--(i)))       for (int j = (m), jLimit = (1); j >= jLimit; (--(j)))         if (i != n || j != m) {           Dpr[i][j] = Dec(Sumd[i][j + 1], Sumd[i][m - r[i][j] + 1]);           Dpd[i][j] = Dec(Sumr[i + 1][j], Sumr[n - d[i][j] + 1][j]);           Sumr[i][j] = Inc(Sumr[i + 1][j], Dpr[i][j]);           Sumd[i][j] = Inc(Sumd[i][j + 1], Dpd[i][j]);         }     printf( %d , Inc(Dpr[1][1], Dpd[1][1]));     return 0;   }   