#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;
const int MOD = 1000000007;
const double pi = acos(-1);

int main() {
    int h,w; cin >> h >> w;
    vector<string> s(h);
    REP(i,h) cin >> s[i];

    vecvecl dp(h,vecl(w)), x(h+1,vecl(w+1)), y(h+1,vecl(w+1)), z(h+1,vecl(w+1));

    dp[0][0] = 1;

    REP(i,h) REP(j,w) {
        if(s[i][j] != '#') dp[i][j] += x[i][j] + y[i][j] + z[i][j];
        dp[i][j] %= MOD;
        if(j+1 < w) {
            if(s[i][j+1] != '#') x[i][j+1] = x[i][j] + dp[i][j];
            else x[i][j] = 0;
        }
        x[i][j+1] %= MOD;
        if(i+1 < h) if(s[i+1][j] != '#') y[i+1][j] = y[i][j] + dp[i][j]; else y[i+1][j] = 0;
        y[i+1][j] %= MOD;
        if(i+1 < h && j+1 < w) if(s[i+1][j+1] != '#') z[i+1][j+1] = z[i][j] + dp[i][j]; else z[i+1][j+1] = 0;
        z[i+1][j+1] %= MOD;
    }

    cout << dp[h-1][w-1] << endl;
}

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
const ll MOD = 1e9+7;

int main(){
        ll i,j,H,W,r_yoko;;
        cin >> H >> W;
        vector<vector<ll>> dp(H,vector<ll>(W));
        vector<vector<char>> mp(H,vector<char>(W));
        dp.at(0).at(0) = 1;
        for(i=0;i<H;++i){
                for(j=0;j<W;++j){
                        cin >> mp.at(i).at(j);
                }
        }
        vector<ll> r_nana(H+W-1);
        vector<ll> r_tate(W);
        for(i=0;i<H;++i){
                r_yoko = 0;
                for(j=0;j<W;++j){
                        if(mp.at(i).at(j)=='#'){
                                r_yoko = 0;
                                r_tate.at(j)=0;
                                r_nana.at(j-i+H-1)=0;
                                continue;
                        }
                        dp.at(i).at(j) += r_yoko+r_tate.at(j);
                        dp.at(i).at(j) += r_nana.at(j-i+H-1);
                        dp.at(i).at(j) %= MOD;
                        r_tate.at(j) += dp.at(i).at(j);
                        r_tate.at(j) %= MOD;
                        r_yoko += dp.at(i).at(j);
                        r_yoko %= MOD;
                        r_nana.at(j-i+H-1) += dp.at(i).at(j);
                        r_nana.at(j-i+H-1) %= MOD;
                }
        }
        cout << dp.at(H-1).at(W-1) << endl;
        return 0;
}