// Arup Guha
// 3/31/2015
// Solution to NAIPC 2015 Problem D: Extensive Or

import java.util.*;

public class extensiveor {

	// Input for a case.
	public static int n;
	public static int exponent;
	public static int[] bits;

	// Used for general computation.
	public static long[][][] move;
	final public static long MOD = 1000000007L;
	final public static int INVALID = -1;

	public static void main(String[] args) {

		// Read input.
		Scanner stdin = new Scanner(System.in);
		n = stdin.nextInt();
		exponent = stdin.nextInt();
		char[] tmp = stdin.next().toCharArray();
		bits = new int[tmp.length];
		for (int i=0; i<tmp.length; i++)
			bits[i] = tmp[i] - '0';

		// Unrelated to specific input (except for using n),
		// needed to calculate base matrix to exponentiate.
		computeMoveArray();

		// Get our base matrix.
		long[][] myBase = getOneIter();
		long[][] res = exp(myBase, exponent);

		// Entry in top right corner is our answer!
		System.out.println(res[0][(1<<n)-1]);
	}

	// Computes the move matrices. move[0][j][k] is how many sets of bits with even xor
	// take us from state j to state k if the current string bit is 0 and
	// move[1][j][k] is how many sets of bits take us from state j to k
	// if the current string bit is 1.
	public static void computeMoveArray() {
		move = new long[2][1 << n][];
		for (int i=0; i<2; i++)
			for (int j=0; j<(1<<n); j++)
				move[i][j] = computeFrom(i,j);
	}

	// Returns the frequency of results from the given mask with the current string bit
	// is bit. If the mask is 011, for example, this means that the first and second
	// numbers in our list are currently equal, but the second and third numbers are
	// not and the third number and the limiting number (R in the input spec) are not
	// equal. Essentially, bit i is 0 if numbers i and i+1 are the same, different
	// otherwise, with the last bit indicating if the last number is equal to our
	// limiting number or not.
	public static long[] computeFrom(int bit, int mask) {

		// Store our answers here.
		long[] res = new long[1 << n];

		// Just loop through each possible set of bits for this column,
		for (int col=0; col<(1<<n); col++) {

			// XOR equals 0 only with an even number of 1s.
			if (Integer.bitCount(col)%2 != 0) continue;

			// Compute which mask we end up with, using these bits.
			int newmask = transition(mask, (bit<<n) + col);

			// Ended up not working...
			if (newmask == INVALID) continue;

			// Count it. No need to mod, since this will never be > 10^9...
			res[newmask]++;
		}

		return res;
	}

	// col is the column of bits to add appended with the current bit from R on the left.
	public static int transition(int mask, int col) {

		// Check ordering for 0 bits in mask, including the last bit compared to R.
		for (int i=0; i<n; i++)
			if (((mask >> i) & 1) == 0)
				if ( ((col >> i) & 1) > ((col >> (i+1)) & 1) ) return -1;

		// Our new mask is just going to change if two numbers that
		// used to be equal are no longer equal.
		int newmask = mask;
		for (int i=0; i<n; i++)
			if (((mask >> i) & 1) == 0)
				if ( ((col >> i) & 1) != ((col >> (i+1)) & 1) )
					newmask += (1 << i);

		return newmask;
	}

	// Returns the composite matrix for "combinations" going through
	// one full iteration of the string.
	public static long[][] getOneIter() {
		long[][] res = identity(1 << n);
		for (int i=0; i<bits.length; i++)
			res = mult(res, move[bits[i]]);
		return res;
	}

	// Returns the identity matrix of size n x n.
	public static long[][] identity(int n) {
		long[][] mat = new long[n][n];
		for (int i=0; i<n; i++)
			mat[i][i] = 1;
		return mat;
	}

	// Returns a x b with entries computed mod MOD.
	public static long[][] mult(long[][] a, long[][] b) {

		int size = a.length;
		long[][] res = new long[size][size];

		for (int i=0; i<size; i++)
			for (int j=0; j<size; j++)
				for (int k=0; k<size; k++)
					res[i][j] = (res[i][j] + a[i][k]*b[k][j])%MOD;

		return res;
	}

	// Returns base ^ power with all entries computed mod MOD.
	public static long[][] exp(long[][] base, int power) {

		// Base cases.
		if (power == 0) return identity(base.length);
		if (power == 1) return base;

		// Even exponent case.
		if (power%2 == 0) {
			long[][] mysqrt = exp(base, power/2);
			return mult(mysqrt, mysqrt);
		}

		// Slow recursive algorithm necessary.
		return mult(exp(base, power-1), base);
	}
}
