#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;

int main() {
  int H, W; cin >> H >> W;

  vector<vector<int>> dp(H + 1, vector<int>(W + 1));
  dp[0][1] = 1;

  for (int i = 1; i <= H; i++)
  {
    for (int j = 1; j <= W; j++)
    {
      char c; cin >> c;
      if (c == '#') continue;
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
    }
  }

  cout << dp[H][W] << endl;
}