using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace EDP_H
{
    class Program
    {
        static readonly char Wall = '#';

        static void Solve()
        {
            var h = Input.NextInt();
            var w = Input.NextInt();

            var maze = new List<List<char>>();
            foreach (var _ in Enumerable.Range(0, h))
            {
                maze.Add(Input.Next().ToList());
            }

            var mod = new Modulo();
            var dp = new int[h, w];

            dp[0, 0] = 1;

            foreach (var i in Enumerable.Range(0, h))
            {
                foreach (var j in Enumerable.Range(0, w))
                {
                    if (i + 1 < h && maze[i + 1][j] != Wall) dp[i + 1, j] = (int)mod.Add(dp[i + 1, j], dp[i, j]);
                    if (j + 1 < w && maze[i][j + 1] != Wall) dp[i, j + 1] = (int)mod.Add(dp[i, j + 1], dp[i, j]);
                }
            }

            Console.WriteLine(dp[h - 1, w - 1]);
        }

        /// <summary>
        /// Mを法とする数値
        /// </summary>
        class Modulo
        {
            public long M { get; private set; }
            private bool mIsPrime;

            public Modulo(long m = (long)1e9 + 7)
            {
                this.M = m;
                this.mIsPrime = isPrime(m);
            }

            public long Add(long a, long b)
            {
                return (a + b) % this.M;
            }

            public long Sub(long a, long b)
            {
                return (a + this.M - b) % this.M;
            }

            public long Mul(long a, long b)
            {
                return ((a % this.M) * (b % this.M)) % this.M;
            }

            public long Power(long x, long y)
            {
                switch (y)
                {
                    case 0: return 1;
                    case 1: return x;

                    default:
                        long z1 = Power(x, y / 2);
                        long z2 = Mul(z1, z1);

                        if ((y % 2) == 0)
                        {
                            return z2;
                        }
                        else
                        {
                            return Mul(z2, x);
                        }
                }
            }

            public long Div(long a, long b)
            {
                if (!this.mIsPrime)
                {
                    throw new ArgumentException();
                }

                return Mul(a, Power(b, this.M - 2));
            }

            /// <summary>
            /// 素数か
            /// </summary>
            /// <param name="x"></param>
            /// <returns></returns>
            static bool isPrime(long x)
            {
                if (x < 2)
                {
                    return false;
                }
                if (x == 2)
                {
                    return true;
                }
                if ((x % 2) == 0)
                {
                    return false;
                }

                long rx = (long)(Math.Sqrt(x) + 1);
                for (long n = 3; n < rx; n += 2)
                {
                    if ((x % n) == 0)
                    {
                        return false;
                    }
                }

                return true;
            }
        }

        #region Competitive Template
        public static void Main(string[] args)
        {
            var needsFlushOutput = true;
            if (needsFlushOutput)
            {
                // 細かく出力しないようにする
                var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
                Console.SetOut(sw);
            }

            // 仮想的に標準入力をセットする
            // NextLine系を使っていると使えない
            //Input.SetText("");

            Solve();

            Console.Out.Flush();
        }

        static class Input
        {
            static char[] separator = { ' ' };
            public static bool IsEof { get; set; }
            static Queue<string> q { get; set; }

            static Input()
            {
                IsEof = false;
                q = new Queue<string>();
            }

            /// <summary>
            /// 入力予約
            /// </summary>
            /// <param name="items"></param>
            public static void SetText(IEnumerable<string> items)
            {
                foreach (var item in items)
                {
                    SetText(item);
                }
            }

            /// <summary>
            /// 入力予約
            /// </summary>
            /// <param name="s"></param>
            /// <returns></returns>
            public static bool SetText(string s)
            {
                if (s == null) return false;

                foreach (var elem in s.Trim().Split(separator, StringSplitOptions.RemoveEmptyEntries))
                {
                    q.Enqueue(elem);
                }

                return true;
            }

            /// <summary>
            /// 内部queueに入力からの値をsplitして格納する
            /// </summary>
            /// <returns></returns>
            static bool read()
            {
                var s = Console.ReadLine();
                if (s == null) return false;

                foreach (var elem in s.Trim().Split(separator, StringSplitOptions.RemoveEmptyEntries))
                {
                    q.Enqueue(elem);
                }

                if (!q.Any()) return read();

                return true;
            }

            /// <summary>
            /// 次のstringを一つ読み込む
            /// </summary>
            /// <returns></returns>
            public static string Next()
            {
                if (!q.Any())
                {
                    if (!read())
                    {
                        IsEof = true;
                        return "";
                    }
                }

                return q.Dequeue();
            }

            public static int NextInt() => int.Parse(Next());
            public static long NextLong() => long.Parse(Next());
            public static double NextDouble() => double.Parse(Next());

            public static List<string> Next(int n) => Enumerable.Range(0, n).Select(_ => Next()).ToList();
            public static List<int> NextInt(int n) => Next(n).Select(x => int.Parse(x)).ToList();
            public static List<long> NextLong(int n) => Next(n).Select(x => long.Parse(x)).ToList();
            public static List<double> NextDouble(int n) => Next(n).Select(x => double.Parse(x)).ToList();

            public static List<string> NextLine() => Console.ReadLine().Trim().Split(separator, StringSplitOptions.RemoveEmptyEntries).ToList();
            public static List<int> NextIntLine() => NextLine().Select(x => int.Parse(x)).ToList();
            public static List<long> NextLongLine() => NextLine().Select(x => long.Parse(x)).ToList();
            public static List<double> NextDoubleLine() => NextLine().Select(x => double.Parse(x)).ToList();
        }
        #endregion
    }
}


Measured memory_bytes: 25428