func_code_string: #include <bits/stdc++.h>   using namespace std;   int N, M;   string s[2020];   long long dp[2020][2020][2], C[2020][2020][2], S[2020][2020][2];   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cin >> N >> M;     for (int i = 1; i <= N; i++) {       cin >> s[i];       s[i] =  #  + s[i];     }     for (int i = N; i >= 1; i--)       for (int j = M; j >= 1; j--) {         C[i][j][0] = C[i][j + 1][0] + (s[i][j] ==  R );         C[i][j][1] = C[i + 1][j][1] + (s[i][j] ==  R );         if (i == N && j == M) {           dp[i][j][0] = dp[i][j][1] = 1;         } else {           int r = M - C[i][j + 1][0];           int d = N - C[i + 1][j][1];           dp[i][j][0] = (S[i][j + 1][0] - S[i][r + 1][0]) % 1000000007;           dp[i][j][1] = (S[i + 1][j][1] - S[d + 1][j][1]) % 1000000007;         }         S[i][j][0] = (S[i][j + 1][0] + dp[i][j][1]) % 1000000007;         S[i][j][1] = (S[i + 1][j][1] + dp[i][j][0]) % 1000000007;       }     long long res = dp[1][1][0] + dp[1][1][1];     if (N == 1 && M == 1) res = 1;     res %= 1000000007;     res += 1000000007;     res %= 1000000007;     printf( %lld , res);     return 0;   }   