// https://atcoder.jp/contests/abc015/tasks/abc015_4

#include <bits/stdc++.h>

using namespace std;

#define ll long long 
#define REPL(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define radrad(a)  180.0 * a / M_PI
#define pow(x) x*x
static const int MAX = 10010;
static const ll INFTY = 1e12;
static const ll NUMMAX = 1000000007;
static const ll MOD = 1000000007;
#define LOOP 10000000
// 四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

// 入力
int H, W;
vector<string> field;
int result = 100;
int dfs_res = 0;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
void add(ll &a, ll b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

int main() {


    int H, W;
    cin >> H >> W;
    char grid[H][W];
    ll dp[H+10][W+10];
    //vector<int> dp(N+1, MAX);
    REP(i, H)REP(j, W){ cin >> grid[i][j]; }
    REP(i, H+1)REP(j, W+1){ dp[i][j] = 0; }

    dp[0][0] = 1;
    REP(i, H){
        REP(j, W){
            if(i == 0 && j == 0)/*dp[i][j] = 1*/;
            else if(i == 0){
                if(grid[i][j] == '#'){
                    dp[i][j] = 0;
                } else {
                    dp[i][j] = dp[i][j-1];
                }
            }else if(j == 0){
                if(grid[i][j] == '#'){
                    dp[i][j] = 0;
                } else {
                    dp[i][j] = dp[i-1][j];
                }
            }
            else {
                if(grid[i-1][j] == '#' && grid[i][j-1] == '#'){
                    dp[i][j] = 0;
                }
                else if(grid[i-1][j] == '#'){
                    dp[i][j] = dp[i][j-1];
                } else if(grid[i][j-1] == '#'){
                    dp[i][j] = dp[i-1][j];
                } else {
                    dp[i][j] = dp[i-1][j] + dp[i][j-1];
                }
           }
           dp[i][j] %= MOD;
        }
    }

    //for (int i = 0; i < H; ++i) {
    //    for (int j = 0; j < W; ++j) {
    //        if (i+1 < H && grid[i+1][j] == '.') add(dp[i+1][j], dp[i][j]);
    //        if (j+1 < W && grid[i][j+1] == '.') add(dp[i][j+1], dp[i][j]);
    //        //dp[i][j] %= MOD;
    //    }
    //}
//
    //REP(i, H+1){
    //    REP(j, W+1){ 
    //        cout << dp[i][j] << " "; 
    //    }cout << endl; 
    //}
    cout << dp[H-1][W-1] << endl;

    return 0;
}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/




Measured memory_bytes: 9088