The Little Elephant has found a ragged old black-and-white string s on the attic.

The characters of string s are numbered from the left to the right from 1 to |s|, where |s| is the length of the string. Let's denote the i-th character of string s as si. As the string is black-and-white, each character of the string is either letter "B", or letter "W". Unfortunately, the string is very old and some characters are damaged. The damaged positions are denoted as "X".

The Little Elephant in determined to restore the string and hang it on the wall. For that he needs to replace each character "X" by a "B" or a "W". The string must look good on the wall, so it must be beautiful. The Little Elephant considers a string beautiful if it has two non-intersecting substrings of a given length k, such that the left one fully consists of characters "B", and the right one fully consists of characters "W". More formally, there are four integers a, b, c, d (1 ≤ a ≤ b < c ≤ d ≤ |s|; b - a + 1 = d - c + 1 = k) such that si = "B" (a ≤ i ≤ b) and sj = "W" (c ≤ j ≤ d). 

Help the Little Elephant find the number of different beautiful strings he can obtain from string s. Two strings are considered different if there is such position, where the character in the first string differs from the corresponding character in the second string. If this string doesn't contain characters «X» and it is already beautiful — the answer is 1.

As the answer can be rather large, print it modulo 1000000007 (109 + 7).

Input

The first line contains two space-separated integers n and k (1 ≤ k ≤ n ≤ 106). The second line contains string s. String s has length n and only consists of characters "W", "B" and "X".

Output

On a single line print an integer — the answer to the problem modulo 1000000007 (109 + 7).

Examples

Input

3 2
XXX


Output

0


Input

4 2
XXXX


Output

1


Input

10 2
XXBXXWXXXX


Output

166
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.InputStream;

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

class TaskD {
    private static final int MOD = 1000000007;

    public void solve(int testNumber, StreamInputReader in, PrintWriter out) {
        int N = in.nextInt();
        int K = in.nextInt();
        char[] s = ("A" + in.nextString()).toCharArray();

        if(2 * K > N) {
            out.print(0);
            return;
        }

        long[] pow2 = new long[N + 1];
        pow2[0] = 1;
        for(int i = 1; i <= N; i++) {
            pow2[i] = pow2[i - 1] * 2;
            if(pow2[i] >= MOD)
                pow2[i] -= MOD;
        }

        int[] numX = new int[N + 1];
        numX[0] = 0;
        for(int i = 1; i <= N; i++)
            numX[i] = numX[i - 1] + (s[i] == 'X' ? 1 : 0);

        long[] left = ways(s, 'B', 'W', K);

        char[] rev = new char[N + 1];
        rev[0] = s[0];
        for(int i = 1; i <= N; i++)
            rev[i] = s[N - i + 1];

        long[] right = ways(rev, 'W', 'B', K);
        for(int i = 0; i <= N / 2; i++) {
            long aux = right[i];
            right[i] = right[N - i];
            right[N - i] = aux;
        }
        for(int i = N; i >= 0; i--)
            right[i + 1] = right[i];

        int[] sumWhite = new int[N + 1];
        sumWhite[0] = 0;
        for(int i = 1; i <= N; i++)
            sumWhite[i] = sumWhite[i - 1] + (s[i] == 'W' ? 1 : 0);

        int[] sumBlack = new int[N + 1];
        sumBlack[0] = 0;
        for(int i = 1; i <= N; i++)
            sumBlack[i] = sumBlack[i - 1] + (s[i] == 'B' ? 1 : 0);

        long ans = 0;
        long sumRight = 0;

        /*
        for(int i = N - K; i >= K; i--) {
            if(s[i + 1] == 'X')
                sumRight = (sumRight * 2) % MOD;

            if(sumBlack[i + K] == sumBlack[i]) {
                if(i + K == N)
                    sumRight = (sumRight + 1) % MOD;
                else if(i + K == N - 1) {
                    if(s[i + K + 1] != 'W')
                        sumRight = (sumRight + 1) % MOD;
                }
                else if(s[i + K + 1] != 'W')
                    sumRight = (sumRight + right[i + K + 2]) % MOD;
            }

            if(sumWhite[i] == sumWhite[i - K] && s[i - K] != 'B')
                ans = (ans + left[Math.max(0, i - K - 1)] * sumRight) % MOD;
        }
        */

        for(int i = N - K; i >= K; i--) {
            sumRight = (pow2[ numX[N] - numX[i] ] - right[i + 1] + MOD) % MOD;
            if(sumWhite[i] == sumWhite[i - K] && s[i - K] != 'B')
                ans = (ans + left[Math.max(0, i - K - 1)] * sumRight) % MOD;
        }

        out.print(ans);
	}

    private long[] ways(char[] s, char b, char w, int K) {
        int len = s.length - 1;
        int[] sumW = new int[len + 1];
        long[] ret = new long[len + 3];
        sumW[0] = 0;
        ret[0] = 1;
        for(int i = 1; i <= len; i++)
            sumW[i] = sumW[i - 1] + (s[i] == w ? 1 : 0);
        for(int i = 1; i <= len; i++) {
            if(s[i] == 'X')
                ret[i] = (ret[i - 1] * 2) % MOD;
            else
                ret[i] = ret[i - 1];

            if(i >= K && sumW[i] == sumW[i - K] && s[i - K] != b) {
                ret[i] = (ret[i] - ret[Math.max(0, i - K - 1)] + MOD) % MOD;
            }
        }
        return ret;
    }
}

class StreamInputReader extends InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar, numChars;

    public StreamInputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    }

abstract class InputReader {

    public abstract int read();

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

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    }

