You are at the top left cell (1, 1) of an n × m labyrinth. Your goal is to get to the bottom right cell (n, m). You can only move right or down, one cell per step. Moving right from a cell (x, y) takes you to the cell (x, y + 1), while moving down takes you to the cell (x + 1, y).

Some cells of the labyrinth contain rocks. When you move to a cell with rock, the rock is pushed to the next cell in the direction you're moving. If the next cell contains a rock, it gets pushed further, and so on.

The labyrinth is surrounded by impenetrable walls, thus any move that would put you or any rock outside of the labyrinth is illegal.

Count the number of different legal paths you can take from the start to the goal modulo 10^9 + 7. Two paths are considered different if there is at least one cell that is visited in one path, but not visited in the other.

Input

The first line contains two integers n, m — dimensions of the labyrinth (1 ≤ n, m ≤ 2000).

Next n lines describe the labyrinth. Each of these lines contains m characters. The j-th character of the i-th of these lines is equal to "R" if the cell (i, j) contains a rock, or "." if the cell (i, j) is empty.

It is guaranteed that the starting cell (1, 1) is empty.

Output

Print a single integer — the number of different legal paths from (1, 1) to (n, m) modulo 10^9 + 7.

Examples

Input


1 1
.


Output


1


Input


2 3
...
..R


Output


0


Input


4 4
...R
.RR.
.RR.
R...


Output


4

Note

In the first sample case we can't (and don't have to) move, hence the only path consists of a single cell (1, 1).

In the second sample case the goal is blocked and is unreachable.

Illustrations for the third sample case can be found here: <https://assets.codeforces.com/rounds/1225/index.html>
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        final int MOD = (int) (1e9 + 7);

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int height = in.nextInt();
            int width = in.nextInt();
            int[][] board = new int[height][width];
            for (int r = 0; r < height; r++) {
                char[] buf = in.next().toCharArray();
                for (int c = 0; c < width; c++) {
                    board[height - 1 - r][width - 1 - c] = buf[c] == '.' ? 0 : 1;
                }
            }

            int[][] sumBoard = new int[height + 1][width + 1];
            for (int r = 0; r < height; r++) {
                for (int c = 0; c < width; c++) {
                    addOne(sumBoard, board, r, c);
                }
            }

            int[][][] d = new int[2][height][width];
            int[][][] sd = new int[2][height + 1][width + 1];
            for (int i = 0; i < 2; i++) {
                d[i][0][0] = 1 - board[0][0];
                addOne(sd[i], d[i], 0, 0);
            }

            for (int r = 0; r < height; r++) {
                for (int c = 0; c < width; c++) {
                    for (int firstLeft = 0; firstLeft < 2; firstLeft++) {
                        int nextFirst = firstLeft ^ 1;
                        int r1 = r;
                        int c1 = c;
                        int r2 = r;
                        int c2 = c;
                        if (firstLeft == 1) {
                            c1 = (int) getSum(sumBoard, r, 0, r, c - 1);
                            --c2;
                        } else {
                            r1 = (int) getSum(sumBoard, 0, c, r - 1, c);
                            --r2;
                        }
                        d[firstLeft][r][c] = (int) ((d[firstLeft][r][c] + getSum(sd[nextFirst], r1, c1, r2, c2)) % MOD);
                        addOne(sd[firstLeft], d[firstLeft], r, c);
                    }
                }
            }

            int ans = 0;
            ans += d[0][height - 1][width - 1];
            if (height > 1 || width > 1) {
                ans += d[1][height - 1][width - 1];
            }
            ans %= MOD;
            if (ans < 0) {
                ans += MOD;
            }
            out.println(ans);
        }

        private void addOne(int[][] sum, int[][] a, int r, int c) {
            long val = (long) sum[r][c + 1] + sum[r + 1][c] - sum[r][c] + a[r][c];
            sum[r + 1][c + 1] = (int) (val % MOD);
        }

        private long getSum(int[][] sum, int r1, int c1, int r2, int c2) {
            if (r1 > r2 || c1 > c2) {
                return 0;
            }
            long val = (long) sum[r2 + 1][c2 + 1] - sum[r2 + 1][c1] - sum[r1][c2 + 1] + sum[r1][c1];
            return val;
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

