'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}

function getArray(str) {
    return str.split(' ').map(x => Number(x));
}

function getInt(str) {
    return Number(str);
}

function getStrArray(str) {
    return str.split(' ').map(x => x);
}

function create2DArray(row, col, filler = 0) {
    return Array(row)
        .fill(filler)
        .map(() => Array(col).fill(filler));
}
// ---------------------------------------



function main() {
    let [r, c] = getArray(readline());
    let arr = [];
    const mod = 1e9+7;

    for (let i = 0; i < r; i++) {
        arr.push(readline().split('').map(x => x));
    }

    let dp = create2DArray(r, c, 0);

    dp[0][0] = 1;
    for (let i = 1; i < r; i++) {
        if(arr[i][0] === '#') {
            dp[i][0] = 0;
        } else {
            dp[i][0] = dp[i - 1][0];
        }
    }

    for (let j = 1; j < c; j++) {
        if (arr[0][j] === '#') {
            dp[0][j] = 0;
        } else {
            dp[0][j] = dp[0][j-1];
        }
    }
    
    for (let i = 1; i < r; i++) {
        for (let j = 1; j < c; j++) {
            if(arr[i][j] === '#') {
                dp[i][j] = 0;
            } else {
                dp[i][j] = (dp[i-1][j] + dp[i][j-1])%mod;
            }
        }
    }
    console.log(dp[r-1][c-1]);
}