#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
const int P = 1e9 + 7;
char S[N][N];
int Mp[N][N];
int Dn[N][N], Rt[N][N];
int n, m;
int C[N << 1][N], Siz;
inline void update(int i, int x, int d) {
  while (x <= Siz) (C[i][x] += d) %= P, x += x & -x;
}
inline int query(int i, int x) {
  int res = 0;
  while (x > 0) (res += C[i][x]) %= P, x -= x & -x;
  return res;
}
int main() {
  int i, j;
  scanf("%d%d", &n, &m), Siz = max(n, m);
  for (i = 1; i <= n; i++) scanf(" %s ", S[i] + 1);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) Mp[i][j] = (S[i][j] == '.');
  for (i = 1; i <= m; i++)
    for (j = n; j >= 1; j--) Dn[j][i] = Dn[j + 1][i] + Mp[j + 1][i];
  for (i = 1; i <= n; i++)
    for (j = m; j >= 1; j--) Rt[i][j] = Rt[i][j + 1] + Mp[i][j + 1];
  update(1, 1, 1), update(1, 2, -1);
  update(n + 1, 1, 1), update(n + 1, 2, -1);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      int A = query(i, j), B = query(j + n, i);
      update(i, j + 1, B), update(i, j + Rt[i][j] + 1, -B),
          update(j + n, i + 1, A), update(j + n, i + Dn[i][j] + 1, -A);
    }
  if (n == 1 && m == 1)
    puts("1");
  else
    printf("%d\n", (query(n, m) + query(n + m, n)) % P);
  return 0;
}
