#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool getmin(T *a, const T &b) {
  if (b < *a) {
    *a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool getmax(T *a, const T &b) {
  if (b > *a) {
    *a = b;
    return true;
  }
  return false;
}
template <class T>
inline void read(T *a) {
  char c;
  while (isspace(c = getchar())) {
  }
  bool flag = 0;
  if (c == '-')
    flag = 1, *a = 0;
  else
    *a = c - 48;
  while (isdigit(c = getchar())) *a = *a * 10 + c - 48;
  if (flag) *a = -*a;
}
const int mo = 1000000007;
template <class T>
T pow(T a, T b, int c = mo) {
  T res = 1;
  for (T i = 1; i <= b; i <<= 1, a = 1LL * a * a % c)
    if (b & i) res = 1LL * res * a % c;
  return res;
}
const int MOD = 1000000007;
int N, M;
char a[3005][3005];
int f[3005][3005];
void work(int sx, int sy) {
  memset(f, 0, sizeof(f));
  if (a[sx][sy] == '#') return;
  f[sx][sy] = 1;
  for (int i = sx; i <= N; ++i)
    for (int j = sy; j <= M; ++j)
      if (i != sx || j != sy)
        if (a[i][j] == '.') f[i][j] = (f[i - 1][j] + f[i][j - 1]) % MOD;
}
int main() {
  read(&N);
  read(&M);
  for (int i = 1; i <= N; ++i) scanf("%s", a[i] + 1);
  work(1, 2);
  long long ans1 = f[N - 1][M], ans2 = f[N][M - 1];
  work(2, 1);
  cout << ((ans1 * (long long)f[N][M - 1] - ans2 * (long long)f[N - 1][M]) %
               MOD +
           MOD) %
              MOD
       << endl;
  return 0;
}
