#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(obj)   (obj).begin(),(obj).end()

#define debug(var)  do{std::cout << __LINE__ << "> " << #var << ": ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

template <int Modulus>
struct ModInt {
    long long val;
    constexpr ModInt(const long long v = 0) noexcept : val(v % Modulus) {
        if (val < 0) val += Modulus;
    }

    constexpr ModInt operator + (const ModInt& r) const noexcept { return ModInt(*this) += r; }
    constexpr ModInt operator - (const ModInt& r) const noexcept { return ModInt(*this) -= r; }
    constexpr ModInt operator * (const ModInt& r) const noexcept { return ModInt(*this) *= r; }
    constexpr ModInt operator / (const ModInt& r) const noexcept { return ModInt(*this) /= r; }
    
    constexpr ModInt& operator += (const ModInt& r) noexcept {
        val += r.val;
        if (val >= Modulus) val -= Modulus;
        return *this;
    }
    constexpr ModInt& operator -= (const ModInt& r) noexcept {
        val -= r.val;
        if (val < 0) val += Modulus;
        return *this;
    }
    constexpr ModInt& operator *= (const ModInt& r) noexcept {
        val = val * r.val % Modulus;
        return *this;
    }
    constexpr ModInt& operator /= (const ModInt& r) noexcept {
        long long a = r.val, b = Modulus, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % Modulus;
        if (val < 0) val += Modulus;
        return *this;
    }

    constexpr bool operator == (const ModInt& r) const noexcept { return val == r.val; }
    constexpr bool operator != (const ModInt& r) const noexcept { return val != r.val; }
    constexpr bool operator < (const ModInt& r) const noexcept { return val < r.val; }
    constexpr bool operator <= (const ModInt& r) const noexcept { return val <= r.val; }
    constexpr bool operator > (const ModInt& r) const noexcept { return val > r.val; }
    constexpr bool operator >= (const ModInt& r) const noexcept { return val >= r.val; }

    constexpr ModInt operator - () const noexcept {
        return val ? Modulus - val : 0;
    }

    ModInt pow(long long n) {
        ModInt res(1), tmp(val);
        while (n > 0) {
            if (n & 1) res *= tmp;
            tmp *= tmp;
            n >>= 1;
        }
        return res;
    }
};

void Main() {
	using mint = ModInt<1000000007>;

	int H, W; cin >> H >> W;
	vector<string> a(H);
	REP(i,H) cin >> a[i];
	vector<vector<mint>> dp(H, vector<mint>(W, 0));
	dp[H - 1][W - 1] = 1;
	
	REP(i,H) REP(j,W) {
		if (H - i < H) {
			dp[H - i - 1][W - j - 1] += dp[H - i][W - j - 1];
		}
		if (W - j < W) {
			dp[H - i - 1][W - j - 1] += dp[H - i - 1][W - j];
		}
		if (a[H - i - 1][W - j -1] == '#') {
			dp[H - i - 1][W - j - 1] = 0;
		}
	}

	cout << dp[0][0].val << endl;
}

int main() {
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 9216