import java.io.*;
import java.util.*;

public class F946{

    long[] fibpow;
    char[] chs;
    long mod = 1000000007L;
    long modpow = mod-1L;
    long[][][] memo;

    long pow(long m, long n){
        long res = 1;
        while(n > 0){
            if(n % 2 == 1)res = (res*m)%mod;
            m = (m*m)%mod;
            n = n/2;
        }
        return res;
    }

    private void solve() throws Exception {
        int n = nextInt();
        int x = nextInt();
        chs = nextToken().toCharArray();
        memo = new long[n][n][x+1];
        for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) Arrays.fill(memo[i][j], -1);
        fibpow = new long[x+1];
        if(x > 0) fibpow[1] = 1L;
        for(int i = 2; i <= x; i++) fibpow[i] = (fibpow[i-1]+ fibpow[i-2])%modpow;
        for(int i = 0; i <= x; i++) fibpow[i] = pow(2, fibpow[i]);
        out.println(doit(0,n-1,x));
    }

    long doit(int i, int j, int x) {
        if (x < 2 && i == j && chs[i]-'0' == x) return 1L;
        else if (x < 2 && i == j && chs[i]-'0' != x) return 0L;
        else if(x < 2 && i < j) return 0L;
        else if(memo[i][j][x] < 0){
            long res = 0L;
            res = (res + ((i==0?fibpow[x]:(1L)) * doit(i,j, x-2))%mod)%mod;
            for(int t = i; t < j; t++) res = (res + (doit(i,t,x-1) * doit(t+1,j, x-2))%mod)%mod;
            res = (res + (doit(i,j,x-1) * (j==chs.length-1? fibpow[x-1]:(1L)))%mod)%mod;
            memo[i][j][x] = res;
        }
        return memo[i][j][x];
    }

    public static void main(String[] args) {
        (new F946()).run();
    }

    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tokenizer;

    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            in.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private float nextFloat() throws IOException {
        return Float.parseFloat(nextToken());
    }

    private String nextLine() throws IOException {
        return new String(in.readLine());
    }

    private String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(in.readLine());
        }
        return tokenizer.nextToken();
    }

}

// practice with rainboy
import java.io.*;
import java.util.*;

public class CF946F extends PrintWriter {
	CF946F() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF946F o = new CF946F(); o.main(); o.flush();
	}

	static final int MD = 1000000007;
	long power(int a, int k) {
		if (k == 0)
			return 1;
		long p = power(a, k >> 1);
		p = p * p % MD;
		if ((k & 1) == 1)
			p = p * a % MD;
		return p;
	}
	void main() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		byte[] cc = sc.next().getBytes();
		if (x == 0) {
			println(n == 1 && cc[0] == '0' ? 1 : 0);
			return;
		}
		int[] ff = new int[x + 1];
		ff[0] = ff[1] = 1;
		for (int i = 2; i <= x; i++)
			ff[i] = (ff[i - 1] + ff[i - 2]) % (MD - 1);
		for (int i = 0; i <= x; i++)
			ff[i] = (int) power(2, ff[i]);
		int[][][] ds = new int[x + 1][n][n + 1];
		for (int l = 0; l < n; l++) {
			ds[0][l][l] = ds[1][l][l] = 1;
			ds[0][l][l + 1] = cc[l] == '0' ? 1 : 0;
			ds[1][l][l + 1] = cc[l] == '1' ? 1 : 0;
		}
		for (int i = 2; i <= x; i++)
			for (int l = 0; l < n; l++)
				for (int r = l; r < n; r++) {
					long z = 0;
					for (int m = l; m <= r; m++)
						z = (z + (long) ds[i - 1][l][m] * ds[i - 2][m][r]) % MD;
					ds[i][l][r] = (int) z;
				}
		int[][] dp = new int[x + 1][n];
		int[][] dq = new int[x + 1][n];
		if (n > 1) {
			dp[0][n - 1] = ds[0][n - 1][n];
			dp[1][n - 1] = ds[1][n - 1][n];
			for (int i = 2; i <= x; i++)
				for (int l = 1; l < n; l++) {
					long z = (long) dp[i - 1][l] * ff[i - 2] % MD;
					for (int m = l; m < n; m++)
						z = (z + (long) ds[i - 1][l][m] * dp[i - 2][m]) % MD;
					dp[i][l] = (int) z;
				}
			dq[0][1] = ds[0][0][1];
			dq[1][1] = ds[1][0][1];
			for (int i = 2; i <= x; i++)
				for (int r = 1; r < n; r++) {
					long z = (long) ff[i - 1] * dq[i - 2][r] % MD;
					for (int m = r; m > 0; m--)
						z = (z + (long) dq[i - 1][m] * ds[i - 2][m][r]) % MD;
					dq[i][r] = (int) z;
				}
		}
		int[] dr = new int[x + 1];
		dr[0] = ds[0][0][n];
		dr[1] = ds[1][0][n];
		for (int i = 2; i <= x; i++) {
			long z = ((long) dr[i - 1] * ff[i - 2] + (long) ff[i - 1] * dr[i - 2]) % MD;
			for (int m = 1; m < n; m++)
				z = (z + (long) dq[i - 1][m] * dp[i - 2][m]) % MD;
			dr[i] = (int) z;
		}
		println(dr[x]);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.StringTokenizer;
import java.io.Writer;
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
 *
 * @author palayutm
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        ProblemFFibonacciStringSubsequences solver = new ProblemFFibonacciStringSubsequences();
        solver.solve(1, in, out);
        out.close();
    }

    static class ProblemFFibonacciStringSubsequences {
        int mod = (int) 1e9 + 7;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt(), X = in.nextInt();
            String s = in.next();
            long[][][] f = new long[Math.max(2, X + 1)][s.length()][s.length()];
            for (int i = 0; i < s.length(); i++) {
                f[s.charAt(i) - '0'][i][i] = 1;
            }
            int[] fib = new int[Math.max(2, X + 1)];
            fib[0] = fib[1] = 1;
            for (int i = 2; i <= X; i++) {
                fib[i] = (fib[i - 2] + fib[i - 1]) % (mod - 1);
            }
            for (int i = 2; i <= X; i++) {
                for (int L = 0; L < s.length(); L++) {
                    for (int R = 0; R < s.length(); R++) {
                        f[i][L][R] = (L == 0 ? IntegerUtils.powMod(2, fib[i - 1], mod) : 1) * f[i - 2][L][R];
                        f[i][L][R] += (R == s.length() - 1 ? IntegerUtils.powMod(2, fib[i - 2], mod) : 1) * f[i - 1][L][R];
                        f[i][L][R] %= mod;
                        for (int m = L; m < R; m++) {
                            f[i][L][R] = (f[i][L][R] + f[i - 1][L][m] * f[i - 2][m + 1][R]) % mod;
                        }
                    }
                }
            }
            out.println(f[X][0][s.length() - 1]);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

    }

    static class IntegerUtils {
        public static long powMod(long x, long y, int mod) {
            long ret = 1;
            x %= mod;
            while (y > 0) {
                if (y % 2 > 0) {
                    ret = ret * x % mod;
                }
                x = x * x % mod;
                y >>= 1;
            }
            return ret;
        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream out) {
            super(out);
        }

        public OutputWriter(Writer out) {
            super(out);
        }

        public void close() {
            super.close();
        }

    }
}

import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class F {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        // Scanner scan = new Scanner(System.in);
        // PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        // int n = Integer.parseInt(bf.readLine());
        StringTokenizer st = new StringTokenizer(bf.readLine());
        // int[] a = new int[n];
        // for(int i=0; i<n; i++) a[i] =  Integer.parseInt(st.nextToken());
        int n = Integer.parseInt(st.nextToken());
        int x = Integer.parseInt(st.nextToken());

        String s = bf.readLine();
        if(x==0) {
          if(s.equals("0"))
            System.out.println("1");
          else System.out.println("0");
          System.exit(0);
        }
        int mod = 1000000007;
        int[][][] dp = new int[n][n][x+1];
        int[][][] dp_begin = new int[n][n][x+1];
        int[][][] dp_end = new int[n][n][x+1];
        int[][][] dp_final = new int[n][n][x+1];
        int[] fibonacci = new int[x+1];
        fibonacci[0] = 1;
        if(x >= 1) fibonacci[1] = 1;
        for(int i=2; i<=x; i++)
          fibonacci[i] = (int)((fibonacci[i-1] + fibonacci[i-2]) % (mod - 1));
        for(int i=0; i<n; i++) {

              if(s.charAt(i) == '1') dp[i][i][1] = 1;
              if(s.charAt(i) == '0') dp[i][i][0] = 1;
              if(s.charAt(i) == '1') dp_begin[i][i][1] = 1;
              if(s.charAt(i) == '0') dp_begin[i][i][0] = 1;
              if(s.charAt(i) == '1') dp_end[i][i][1] = 1;
              if(s.charAt(i) == '0') dp_end[i][i][0] = 1;
              if(s.charAt(i) == '1') dp_final[i][i][1] = 1;
              if(s.charAt(i) == '0') dp_final[i][i][0] = 1;

        }
        int[] exponential = new int[x+1];
        for(int i=0; i<=x; i++) exponential[i] = exp(2, fibonacci[i], mod);
        for(int k=2; k<=x; k++) {
          for(int i=0; i<n; i++) {
            for(int j=i; j<n; j++) {

              int sum = 0;
              long toAdd = 1;
              for(int c=0; c<=j-i+1; c++) {
                toAdd = 1;
                if(c != 0) toAdd *= dp[i][i+c-1][k-1];
                if(c != j-i+1) toAdd *= dp[i+c][j][k-2];
                toAdd %= mod;

                sum = (int)((0L + sum + toAdd) % mod);
              }
              dp[i][j][k] = sum;
            }
          }
        }
        for(int k=2; k<=x; k++) {
          for(int i=0; i<n; i++) {
            for(int j=i; j<n; j++) {

              int sum = 0;
              long toAdd = 1;
              for(int c=0; c<=j-i+1; c++) {
                toAdd = 1;
                if((c != 0) && (c != j-i+1)) {
                  toAdd *= dp_begin[i][i+c-1][k-1];
                  toAdd *= dp[i+c][j][k-2];
                }
                else if(c == 0) {
                  toAdd *= exponential[k-1];
                  toAdd *= dp_begin[i+c][j][k-2];
                }
                else if(c == j-i+1)  {
                  toAdd *= dp_begin[i][i+c-1][k-1];
                }
                toAdd %= mod;
                sum = (int)((0L + sum + toAdd) % mod);
              }
              dp_begin[i][j][k] = sum;
            }
          }
        }
        for(int k=2; k<=x; k++) {
          for(int i=0; i<n; i++) {
            for(int j=i; j<n; j++) {

              int sum = 0;
              long toAdd = 1;
              for(int c=0; c<=j-i+1; c++) {
                toAdd = 1;
                if((c != 0) && (c != j-i+1)) {
                  toAdd *= dp[i][i+c-1][k-1];
                  toAdd *= dp_end[i+c][j][k-2];
                }
                else if(c == 0) {

                  toAdd *= dp_end[i+c][j][k-2];
                }
                else if(c == j-i+1)  {
                  toAdd *= exponential[k-2];
                  toAdd *= dp_end[i][i+c-1][k-1];
                }
                toAdd %= mod;
                sum = (int)((0L + sum + toAdd) % mod);
              }
              dp_end[i][j][k] = sum;
            }
          }
        }
        for(int k=2; k<=x; k++) {
          for(int i=0; i<n; i++) {
            for(int j=i; j<n; j++) {

              int sum = 0;
              long toAdd = 1;
              for(int c=0; c<=j-i+1; c++) {
                toAdd = 1;
                if((c != 0) && (c != j-i+1)) {
                  toAdd *= dp_begin[i][i+c-1][k-1];
                  toAdd *= dp_end[i+c][j][k-2];
                }
                else if(c == 0) {
                  toAdd *= 1L*exponential[k-1]*dp_final[i+c][j][k-2];

                }
                else if(c == j-i+1) {
                  toAdd *= 1L*dp_final[i][i+c-1][k-1]*exponential[k-2];
                }

                toAdd %= mod;
                sum = (int)((0L + sum + toAdd) % mod);
              }
              dp_final[i][j][k] = sum;
            }
          }
        }
        //System.out.println(dp[0][0][3]);
      //  System.out.println("Occurences: " + dp[0][n-1][x]);
        int ans = dp_final[0][n-1][x];

        System.out.println(ans);
        // out.close(); System.exit(0);
    }

    public static int exp(int base, int e, int mod) {
      if(e == 0) return 1;
      if(e == 1) return base;
      int val = exp(base, e/2, mod);
      int ans = (int)(1L*val*val % mod);
      if(e % 2 == 1)
        ans = (int)(1L*ans*base % mod);
      return ans;
    }
}

import java.io.*;

/**
 * Created by dalt on 2018/3/25.
 */
public class CF946F {
    public static BlockReader input;
    public static PrintStream output;
    public static void main(String[] args) throws FileNotFoundException {
        if (System.getProperty("ONLINE_JUDGE") == null) {
            input = new BlockReader(new FileInputStream("D:\\DataBase\\TESTCASE\\codeforces\\CF946F.in"));
            output = System.out;
        }else{
            input = new BlockReader(System.in);
            output = new PrintStream(new BufferedOutputStream(System.out), false);
        }

        solve();

        output.flush();
    }

    public static void solve() {
        int n = input.nextInteger();
        int x = input.nextInteger();
        String s = input.nextBlock();
        int slen = s.length();
        final long MOD = 1000000007;
        final int ALIGN_LEFT = 0;
        final int ALIGN_RIGHT = 1;
        final int ALIGN_CENTER = 2;
        final int ALIGN_LEFT_RIGHT = 3;

        long[][][][] dp = new long[Math.max(x + 1, 2)][slen + 1][slen + 1][4];
        long[] lengthes = new long[101];
        lengthes[0] = lengthes[1] = 1;

        for (int j = 0, bound = 2; j < bound; j++) {
            for (int i = 0; i <= slen; i++) {
                for (int k = 0; k < 4; k++) {
                    dp[j][i][i][ALIGN_LEFT] = 2;
                    dp[j][i][i][ALIGN_RIGHT] = 2;
                    dp[j][i][i][ALIGN_CENTER] = 2;
                    dp[j][i][i][ALIGN_LEFT_RIGHT] = 1;
                }
            }
        }

        for (int i = 0; i < slen; i++) {
            int c = s.charAt(i) - '0';
            dp[c][i][i + 1][ALIGN_LEFT] = 1;
            dp[c][i][i + 1][ALIGN_RIGHT] = 1;
            dp[c][i][i + 1][ALIGN_CENTER] = 1;
            dp[c][i][i + 1][ALIGN_LEFT_RIGHT] = 1;
        }

        for (int i = 2; i <= x; i++) {
            int last = i - 1;
            int last2 = i - 2;
            lengthes[i] = (lengthes[last] + lengthes[last2]) % (MOD - 1);

            long pLast = pow(2, lengthes[last], MOD);
            long pLast2 = pow(2, lengthes[last2], MOD);
            for (int j = 0; j <= slen; j++) {
                dp[i][j][j][ALIGN_LEFT] = pLast * pLast2 % MOD;
                dp[i][j][j][ALIGN_RIGHT] = dp[i][j][j][ALIGN_LEFT];
                dp[i][j][j][ALIGN_CENTER] = dp[i][j][j][ALIGN_LEFT];
                dp[i][j][j][ALIGN_LEFT_RIGHT] = 1;
                for (int k = j + 1; k <= slen; k++) {
                    dp[i][j][k][ALIGN_LEFT] = (dp[last][j][k][ALIGN_LEFT] * pLast2 + dp[last2][j][k][ALIGN_LEFT]) % MOD;
                    dp[i][j][k][ALIGN_RIGHT] = (dp[last][j][k][ALIGN_RIGHT] + pLast * dp[last2][j][k][ALIGN_RIGHT]) % MOD;
                    dp[i][j][k][ALIGN_CENTER] = (dp[last][j][k][ALIGN_CENTER] * pLast2 + pLast * dp[last2][j][k][ALIGN_CENTER]) % MOD;
                    dp[i][j][k][ALIGN_LEFT_RIGHT] = (dp[last][j][k][ALIGN_LEFT_RIGHT] + dp[last2][j][k][ALIGN_LEFT_RIGHT]) % MOD;
                    for (int sep = j + 1; sep < k; sep++) {
                        dp[i][j][k][ALIGN_LEFT] = (dp[i][j][k][ALIGN_LEFT] + dp[last][j][sep][ALIGN_LEFT_RIGHT] * dp[last2][sep][k][ALIGN_LEFT]) % MOD;
                        dp[i][j][k][ALIGN_RIGHT] = (dp[i][j][k][ALIGN_RIGHT] + dp[last][j][sep][ALIGN_RIGHT] * dp[last2][sep][k][ALIGN_LEFT_RIGHT]) % MOD;
                        dp[i][j][k][ALIGN_LEFT_RIGHT] = (dp[i][j][k][ALIGN_LEFT_RIGHT] + dp[last][j][sep][ALIGN_LEFT_RIGHT] * dp[last2][sep][k][ALIGN_LEFT_RIGHT]) % MOD;
                        dp[i][j][k][ALIGN_CENTER] = (dp[i][j][k][ALIGN_CENTER] + dp[last][j][sep][ALIGN_RIGHT] * dp[last2][sep][k][ALIGN_LEFT]) % MOD;
                    }
                }
            }
        }

         System.out.println(dp[x][0][slen][ALIGN_CENTER]);
    }

    public static long pow(long x, long n, long MOD) {
        int bit = 31;
        for (; bit >= 0 && (n & (1 << bit)) == 0; bit--) ;
        long product = 1;
        for (; bit >= 0; bit--) {
            product = (product * product) % MOD;
            if ((n & (1 << bit)) != 0) {
                product = (product * x) % MOD;
            }
        }
        return (int) product;
    }

    public static class BlockReader {
        static final int EOF = -1;
        InputStream is;
        byte[] dBuf;
        int dPos, dSize, next;
        StringBuilder builder = new StringBuilder();

        public BlockReader(InputStream is) {
            this(is, 4096);
        }

        public BlockReader(InputStream is, int bufSize) {
            this.is = is;
            dBuf = new byte[bufSize];
            next = nextByte();
        }

        public int nextByte() {
            while (dPos >= dSize) {
                if (dSize == -1) {
                    return EOF;
                }
                dPos = 0;
                try {
                    dSize = is.read(dBuf);
                } catch (Exception e) {
                }
            }
            return dBuf[dPos++];
        }

        public String nextBlock() {
            builder.setLength(0);
            skipBlank();
            while (next != EOF && !Character.isWhitespace(next)) {
                builder.append((char) next);
                next = nextByte();
            }
            return builder.toString();
        }

        public void skipBlank() {
            while (Character.isWhitespace(next)) {
                next = nextByte();
            }
        }

        public int nextInteger() {
            skipBlank();
            int ret = 0;
            boolean rev = false;
            if (next == '+' || next == '-') {
                rev = next == '-';
                next = nextByte();
            }
            while (next >= '0' && next <= '9') {
                ret = (ret << 3) + (ret << 1) + next - '0';
                next = nextByte();
            }
            return rev ? -ret : ret;
        }

        public int nextBlock(char[] data, int offset) {
            skipBlank();
            int index = offset;
            int bound = data.length;
            while (next != EOF && index < bound && !Character.isWhitespace(next)) {
                data[index++] = (char) next;
                next = nextByte();
            }
            return index - offset;
        }

        public boolean hasMore() {
            skipBlank();
            return next != EOF;
        }
    }
}

//package educational.round39;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class F2 {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int n = ni(), x = ni();
		char[] s = ns(n);
		long[][][] dp = new long[Math.max(2, x+1)][n][n];
		for(int i = 0;i < n;i++){
			if(s[i] == '0'){
				dp[0][i][i] = 1;
			}else{
				dp[1][i][i] = 1;
			}
		}
		// 0
		// 1
		// 10
		// 101
		// 10110
		int mod = 1000000007;
		long[] F = new long[Math.max(2, x+1)];
		F[0] = F[1] = 1;
		for(int i = 2;i <= x;i++){
			F[i] = (F[i-1] + F[i-2]) % (mod-1);
			for(int j = 0;j < n;j++){
				for(int k = j;k < n;k++){
					dp[i][j][k] += dp[i-1][j][k] * (k == n-1 ? pow(2, F[i-2], mod) : 1);
					dp[i][j][k] += dp[i-2][j][k] * (j == 0 ? pow(2, F[i-1], mod) : 1);
					dp[i][j][k] %= mod;
					for(int l = k+1;l < n;l++){
						dp[i][j][l] +=
								dp[i-1][j][k] *
								dp[i-2][k+1][l];
						dp[i][j][l] %= mod;
					}
				}
			}
		}
		out.println(dp[x][0][n-1]);
	}

	public static long pow(long a, long n, long mod) {
		//		a %= mod;
		long ret = 1;
		int x = 63 - Long.numberOfLeadingZeros(n);
		for (; x >= 0; x--) {
			ret = ret * ret % mod;
			if (n << 63 - x < 0)
				ret = ret * a % mod;
		}
		return ret;
	}

	public static long[] enumPows(int a, int n, int mod)
	{
		a %= mod;
		long[] pows = new long[n+1];
		pows[0] = 1;
		for(int i = 1;i <= n;i++)pows[i] = pows[i-1] * a % mod;
		return pows;
	}

	public static long invl(long a, long mod) {
		long b = mod;
		long p = 1, q = 0;
		while (b > 0) {
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		return p < 0 ? p + mod : p;
	}

	long count(String st, char[] q)
	{
		char[] s = st.toCharArray();
		int[] mp = mpTable(s);
		int p = 0;
		int hit = 0;
		for(int i = 0;i < s.length;i++){
			while(p >= 0 && q[p] != s[i])p = mp[p];
			if(++p == q.length){
				hit++;
				p = mp[p];
			}
		}
		return hit;
	}

	public static int[] mpTable(char[] str)
	{
		int n = str.length;
		int[] mp = new int[n+1];
		mp[0] = -1;
		for(int i = 1, j = 0;i < n;i++){
			while(j >= 0 && str[i] != str[j])j = mp[j];
			mp[i+1] = ++j;
		}
		return mp;
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new F2().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

import java.io.*;
import java.util.*;

public class F implements Runnable{
	public static void main (String[] args) {new Thread(null, new F(), "_cf", 1 << 28).start();}

	int n, x, MOD = (int)1e9 + 7;
	String s;
	int[][][] dp;
	int[] pows = new int[101];

	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("Go!");

		pows[0] = pows[1] = 2;
		for(int i = 2; i < pows.length; i++)
			pows[i] = mult(pows[i - 1], pows[i - 2]);

		n = fs.nextInt();
		x = fs.nextInt();
		s = fs.next();
		dp = new int[n][n][x + 1];
		for(int i = 0; i < dp.length; i++)
			for(int j = 0; j < dp[i].length; j++)
				Arrays.fill(dp[i][j], -1);
		out.println(solve(0, n - 1, x));
		out.close();
	}

	int solve(int l, int r, int x) {
		if(x < 2) {
			if(l != r) return dp[l][r][x] = 0;
			if(s.charAt(l) - '0' == x) return dp[l][r][x] = 1;
			return dp[l][r][x] = 0;
		}
		int ret = dp[l][r][x];
		if(ret != -1) return ret;

		int res = 0;

		//the entire string is contained in F(x - 1) so we have 2^len(F(x-2)) options
		if(r == n - 1) res = add(res, mult(pows[x - 2], solve(l, r, x - 1)));
		else res = add(res, solve(l, r, x - 1));

		//the entire string is contained in F(x - 2) so we have 2^len(F(x-1)) options
		if(l == 0) res = add(res, mult(pows[x - 1], solve(l, r, x - 2)));
		else res = add(res, solve(l, r, x - 2));

		//occurrences of s[l,i] exactly once in all subsequences of F(x - 1)
		//multiplied with occurrences of s[i+1, r] exactly once in all subsequences
		//of F(x - 2)
		for(int i = l; i < r; i++) {
			res = add(res, mult(solve(l, i, x - 1), solve(i + 1, r, x - 2)));
		}
		return dp[l][r][x] = res;
	}

	int add(int a, int b) {
		a %= MOD;
		b %= MOD;
		a += b;
		a %= MOD;
		return a;
	}

	int mult(int a, int b) {
		a %= MOD;
		b %= MOD;
		long c = a;
		c *= b;
		c %= MOD;
		return (int)c;
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}

	}

}

import java.io.*;
import java.util.*;

public class F946{

    long[] fibpow;
    char[] chs;
    long mod = 1000000007L;
    long[][][] memo;

    long pow(long m, long n){
        long res = 1;
        while(n > 0){
            if(n % 2 == 1)res = (res*m)%mod;
            m = (m*m)%mod;
            n = n/2;
        }
        return res;
    }

    private void solve() throws Exception {
        int n = nextInt();
        int x = nextInt();
        chs = nextToken().toCharArray();
        memo = new long[n][n][x+1];
        for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) Arrays.fill(memo[i][j], -1);
        fibpow = new long[x+1];
        if(x > 0) fibpow[1] = 1L;
        for(int i = 2; i <= x; i++) fibpow[i] = (fibpow[i-1]+ fibpow[i-2])%(mod-1L);
        for(int i = 0; i <= x; i++) fibpow[i] = pow(2, fibpow[i]);
        out.println(doit(0,n-1,x));
    }

    long doit(int i, int j, int x) {
        if (x < 2 && i == j && chs[i]-'0' == x) return 1L;
        else if (x < 2 && i == j && chs[i]-'0' != x) return 0L;
        else if(x < 2 && i < j) return 0L;
        else if(memo[i][j][x] < 0){
            memo[i][j][x] = (memo[i][j][x] + ((i==0?fibpow[x]:(1L)) * doit(i,j, x-2))%mod)%mod;
            for(int t = i; t < j; t++) memo[i][j][x] = (memo[i][j][x] + (doit(i,t,x-1) * doit(t+1,j, x-2))%mod)%mod;
            memo[i][j][x] = (memo[i][j][x] + (doit(i,j,x-1) * (j==chs.length-1? fibpow[x-1]:(1L)))%mod)%mod;
        }
        return memo[i][j][x];
    }

    public static void main(String[] args) {
        (new F946()).run();
    }

    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tokenizer;

    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            in.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private float nextFloat() throws IOException {
        return Float.parseFloat(nextToken());
    }

    private String nextLine() throws IOException {
        return new String(in.readLine());
    }

    private String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(in.readLine());
        }
        return tokenizer.nextToken();
    }

}