Consider a circle whose perimeter is divided by N points into N arcs of equal length, and each of the arcs is painted red or blue. Such a circle is said to generate a string S from every point when the following condition is satisfied:

* We will arbitrarily choose one of the N points on the perimeter and place a piece on it.
* Then, we will perform the following move M times: move the piece clockwise or counter-clockwise to an adjacent point.
* Here, whatever point we choose initially, it is always possible to move the piece so that the color of the i-th arc the piece goes along is S_i, by properly deciding the directions of the moves.



Assume that, if S_i is `R`, it represents red; if S_i is `B`, it represents blue. Note that the directions of the moves can be decided separately for each choice of the initial point.

You are given a string S of length M consisting of `R` and `B`. Out of the 2^N ways to paint each of the arcs red or blue in a circle whose perimeter is divided into N arcs of equal length, find the number of ways resulting in a circle that generates S from every point, modulo 10^9+7.

Note that the rotations of the same coloring are also distinguished.

Constraints

* 2 \leq N \leq 2 \times 10^5
* 1 \leq M \leq 2 \times 10^5
* |S|=M
* S_i is `R` or `B`.

Input

Input is given from Standard Input in the following format:


N M
S


Output

Print the number of ways to paint each of the arcs that satisfy the condition, modulo 10^9+7.

Examples

Input

4 7
RBRRBRR


Output

2


Input

3 3
BBB


Output

4


Input

12 10
RRRRBRRRRB


Output

78
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for (int i = (a); i <= (b); ++ i)
#define rrp(i,a,b) for (int i = (a); i >= (b); -- i)
#define gc() getchar()
#define fir first
#define sec second
typedef pair<int,int> pii;
typedef double db;
typedef long long ll;
template <typename tp>
inline void read(tp& x) {
  x = 0; char tmp; bool key = 0;
  for (tmp = gc(); !isdigit(tmp); tmp = gc())
    key = (tmp == '-');
  for (; isdigit(tmp); tmp = gc()) 
    x = (x << 3) + (x << 1) + (tmp ^ '0');
  if (key) x = -x;
}
template <typename tp>
inline void ckmn(tp& x,tp y) {
  x = x < y ? x : y;
}
template <typename tp>
inline void ckmx(tp& x,tp y) {
  x = x < y ? y : x;
}

const int MOD = (int)(1e9 + 7);
inline void Add(int& x,int y) {
  x = x + y >= MOD ? x + y - MOD : x + y;
}
inline void Sub(int& x,int y) {
  x = x - y < 0 ? x - y + MOD : x - y;
}
int power(int a,int b) {
  int ret = 1;
  while (b) {
    if (b&1) ret = 1ll * ret * a % MOD;
    a = 1ll * a * a % MOD;
    b >>= 1;
  }
  return ret;
}

const int N = 200010;
int n, m, arr[N], acnt;
char str[N];
int dp[N];
void doit(int lim) {
  if (n%2) {
    puts("0");
    return;
  }
  lim = (lim + 1) / 2;
  rep (i, 1, n/2) {
    Add(dp[i], dp[i-1]);
    if (i-lim-1 >= 1)
      Sub(dp[i], dp[i-lim-1]);
    if (i <= lim) Add(dp[i], 2 * i);
    Add(dp[i], dp[i-1]);
  }
  int ans = dp[n/2];
  Sub(ans, dp[n/2-1]);
  printf("%d\n", ans);
}
int main() {
  read(n), read(m);
  scanf("%s", str+1);
  if (str[1] == 'R') {
    rep (i, 1, m) {
      if (str[i] == 'R') str[i] = 'B';
      else str[i] = 'R';
    }
  }
  int key = 1;
  rep (i, 2, m) if (str[i] == 'R') key = 0;
  if (key) {
    dp[0] = 1, dp[1] = 2;
    rep (i, 2, n) dp[i] = (dp[i-1] + dp[i-2]) % MOD;
    int ans = dp[n];
    if (n >= 3) Sub(ans, dp[max(0, n - 4)]);
    printf("%d\n", ans);
    return 0;
  }
  for (int i = 1, j = 0; i <= m; ++ i) {
    if (str[i] == 'B') {
      ++ j;
      if (str[i+1] == 'R' && i <= m)
	arr[++ acnt] = j;
    }
    else j = 0;
  }
  int lim = n;
  rep (i, 2, acnt) {
    if (arr[i] % 2 != 0)
      lim = min(lim, arr[i]); 
  }
  lim = min(lim, arr[1] + 1);
  doit(lim);
  return 0;
}
