'use strict'

function main(input){
  const lines = input.split('\n');
  const HW = lines.shift().split(' ').map(x => parseInt(x));
  const H = HW[0];
  const W = HW[1];
  const A = [];
  for(var i =0;i<H;i++){
    A.push(lines.shift().split(''));
  }
  const divider = 10e8+7;

  const dp=[];
  for(var i =0;i<H;i++){
    dp.push(Array(W).fill(0))
  }

  const coordinates = [[0, 0]];
  let current = coordinates.shift();
  while(current != undefined){
    let x = current[0];
    let y = current[1];

    if(y<H-1 && A[y+1][x]!='#'){
      dp[y+1][x]++;
      coordinates.push([x, y+1]);
    }
    if(x<W-1 && A[y][x+1]!='#'){
      dp[y][x+1]++;
      coordinates.push([x+1, y]);
    }

    current = coordinates.shift();
  }

//console.log(dp);

  let result = dp[H-1][W-1];
  console.log(result%divider);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
