#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long UNDEF = -1;
const long long INF = 1e18;
template <typename T>
inline bool chkmax(T &aa, T bb) {
  return aa < bb ? aa = bb, true : false;
}
template <typename T>
inline bool chkmin(T &aa, T bb) {
  return aa > bb ? aa = bb, true : false;
}
const int mn = 3004;
char a[mn][mn];
int total[mn][mn];
int xlim, ylim;
inline void normp(int &x) {
  if (x >= MOD) x -= MOD;
}
inline void normn(int &x) {
  if (x < 0) x += MOD;
}
inline bool valid(int x, int y) {
  return 0 <= x && x < xlim && 0 <= y && y < ylim && a[x][y] != '#';
}
long long f(pair<int, int> s, pair<int, int> t) {
  memset(total, 0, sizeof total);
  int sx = s.first, sy = s.second;
  int tx = t.first, ty = t.second;
  if (!(valid(sx, sy) && valid(tx, ty))) return 0;
  total[sx][sy] = 1;
  for (int x = sx; x <= tx; x++) {
    for (int y = sy; y <= ty; y++) {
      if (valid(x, y)) {
        if (valid(x + 1, y)) {
          total[x + 1][y] += total[x][y];
          normp(total[x + 1][y]);
        }
        if (valid(x, y + 1)) {
          total[x][y + 1] += total[x][y];
          normp(total[x][y + 1]);
        }
      }
    }
  }
  return total[tx][ty];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d\n", &xlim, &ylim);
  for (int x = 0; x < xlim; x++) {
    scanf("%s\n", a[x]);
  }
  pair<int, int> a1 = make_pair(0, 1);
  pair<int, int> b1 = make_pair(xlim - 2, ylim - 1);
  pair<int, int> a2 = make_pair(1, 0);
  pair<int, int> b2 = make_pair(xlim - 1, ylim - 2);
  long long ans = f(a1, b1) * f(a2, b2) - f(a1, b2) * f(a2, b1);
  ans %= MOD;
  if (ans < 0) ans += MOD;
  printf("%lld\n", ans);
}
