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 <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n, m;
char s[300000];

ll d[300000][2];

ll u[300000], v[300000];

int main()
{
    int i, j, k, l;
    ll ans=0;
    cin>>n>>m;
    scanf("%s", s);
    m=strlen(s);
    if(s[0] == 'B')
    {
        for(i=0;i<m;i++) s[i]=s[i]=='R'?'B':'R';
    }
    for(i=0;i<m;i++)
    {
        if(s[i] == 'R') s[i]='o';
        else s[i]='x';
    }
    if(count(s, s+m, 'o') == m)
    {
        for(k=0;k<2;k++)
        {
            d[0][k]=1;
            d[0][!k]=0;
            for(i=1;i<n;i++)
            {
                d[i][0]=d[i-1][0]+d[i-1][1];
                d[i][1]=d[i-1][0];
                d[i][0]%=MOD, d[i][1]%=MOD;
            }
            if(k == 0)
            {
                ans+=d[n-1][0]+d[n-1][1];
            }
            else
            {
                ans+=d[n-1][0];
            }
        }
        ans%=MOD;
    }
    else
    {
        if(n%2 == 1)
        {
            return !printf("0\n");
        }
        n/=2;
        int mi=MAX;
        int cur=0;
        int flag=0;
        for(i=0;i<m;i++)
        {
            if(s[i] == 'o') cur++;
            else
            {
                if(cur)
                {
                    if(flag == 0)
                    {
                        if(cur%2 == 0) cur++;
                    }
                    else
                    {
                        if(cur%2 == 0)
                        {
                            cur=0;
                            continue;
                        }
                    }
                    mi=min(mi, cur);
                    flag=1;
                }
                cur=0;
            }
        }
        mi/=2;
        if(mi >= n-1)
        {
            ans=1;
            for(i=0;i<n;i++) ans*=2, ans%=MOD;
            ans--;
            ans+=MOD;
            ans%=MOD;
        }
        else
        {
            u[0]=v[0]=1;
            u[1]=1, v[1]=2;
            for(i=2;i<n;i++)
            {
                int idx=max(-1, i-mi-2);
                u[i]=(v[i-1]-(idx==-1?0:v[idx]))%MOD;
                u[i]+=MOD;
                u[i]%=MOD;
                v[i]=v[i-1]+u[i];
                v[i]%=MOD;
            }
            for(i=n-1;i>=n-1-mi;i--)
            {
                ans+=u[i]*(n-i);
                ans%=MOD;
            }
        }
        ans*=2;
        ans%=MOD;
    }
    ans+=MOD;
    ans%=MOD;
    cout<<ans<<endl;
    return 0;
}
//*/