#include <bits/stdc++.h>
using namespace std;
constexpr int seed = 131;
constexpr long long LLMAX = 2e18;
constexpr int MOD = 1e9 + 7;
constexpr double eps = 1e-8;
constexpr int MAXN = 1e6 + 10;
constexpr int hmod1 = 0x48E2DCE7;
constexpr int hmod2 = 0x60000005;
inline long long sqr(long long x) { return x * x; }
inline int sqr(int x) { return x * x; }
inline double sqr(double x) { return x * x; }
inline int mul(int x, int y) { return 1ll * x * y % MOD; }
inline int sub(int x, int y) { return x >= y ? x - y : MOD + x - y; }
inline int add(int x, int y) { return x + y >= MOD ? x + y - MOD : x + y; }
inline int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return (x > 0 ? 1 : -1);
}
inline long long qpow(long long a, long long n) {
  long long sum = 1;
  while (n) {
    if (n & 1) sum = sum * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return sum;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d;
  (b == 0 ? (x = 1, y = 0, d = a)
          : (d = exgcd(b, a % b, y, x), y -= a / b * x));
  return d;
}
char a[3010][3010];
int dp1[3010][3010], dp2[3010][3010];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (a[0][1] != '#')
    dp1[0][1] = 1;
  else
    return cout << 0 << endl, 0;
  if (a[1][0] != '#')
    dp2[1][0] = 1;
  else
    return cout << 0 << endl, 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (a[i][j] == '#') continue;
      if (a[i + 1][j] != '#') {
        dp1[i + 1][j] = add(dp1[i + 1][j], dp1[i][j]);
        dp2[i + 1][j] = add(dp2[i + 1][j], dp2[i][j]);
      }
      if (a[i][j + 1] != '#') {
        dp1[i][j + 1] = add(dp1[i][j + 1], dp1[i][j]);
        dp2[i][j + 1] = add(dp2[i][j + 1], dp2[i][j]);
      }
    }
  cout << (1ll * dp1[n - 2][m - 1] * dp2[n - 1][m - 2] % MOD -
           1ll * dp1[n - 1][m - 2] * dp2[n - 2][m - 1] % MOD + MOD) %
              MOD
       << endl;
  return 0;
}
