#include <bits/stdc++.h>
using namespace std;
const int maxN = 3e3 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
int a[maxN][maxN], arumin[2][maxN][maxN];
int main() {
  time_t START = clock();
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  scanf("%d%d", &n, &m);
  getchar();
  for (int i = 0; i < n; i++, getchar())
    for (int j = 0; j < m; j++) {
      char ch = getchar();
      a[i][j] = (ch == '.');
    }
  arumin[0][0][1] = 1;
  arumin[1][1][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int b = 0; b < 2; b++) {
        if (i) arumin[b][i][j] = (arumin[b][i][j] + arumin[b][i - 1][j]) % MOD;
        if (j) arumin[b][i][j] = (arumin[b][i][j] + arumin[b][i][j - 1]) % MOD;
        arumin[b][i][j] *= a[i][j];
      }
  int A = 1ll * arumin[0][n - 2][m - 1] * arumin[1][n - 1][m - 2] % MOD;
  int B = 1ll * arumin[0][n - 1][m - 2] * arumin[1][n - 2][m - 1] % MOD;
  printf("%lld\n", (A + MOD - B) % MOD);
  time_t FINISH = clock();
  cerr << "Execution time: "
       << (long double)(FINISH - START) / CLOCKS_PER_SEC * 1000.0
       << " milliseconds.\n";
  return 0;
}
