#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;


const int H = 105;
const int W = 10;
const int MOD = 1e9 + 7;
int h, w, k;
ll dp[H][W];
ll C[W];

void init() {
    C[1] = 2;
    int a = 1, b = 1;
    for (int i = 2; i < w; ++i) {
        int na = b;
        int nb = a + b;
        C[i] = na + nb;
        a = na;
        b = nb;
    }
}

ll cnt(int x) {
    if (x <= 0) return 1;
    return C[x];
}

int main() {
    cin >> h >> w >> k;
    init();
    for (int i = 0; i < w; ++i) {
        if (i == k - 1)
            dp[h][i] = 1;
        else
            dp[h][i] = 0;
    }
    // cout << dp[15][4] << endl;
    // dp[0][0] => dp[h - 1][k - 1]
    for (int i = h - 1; i >= 0; --i) {
        for (int j = 0; j < w; ++j) {
            dp[i][j] = dp[i + 1][j] * cnt(j - 1) % MOD * cnt(w - j - 2) % MOD; // 0 j 0
            if (j > 0)
                dp[i][j] = (dp[i][j] + dp[i + 1][j - 1] * cnt(j - 2) % MOD * cnt(w - j - 2) % MOD) % MOD; // 1 j 0
            if (j < w - 1)
                dp[i][j] = (dp[i][j] + dp[i + 1][j + 1] * cnt(j - 1) % MOD * cnt(w - j - 3) % MOD) % MOD; // 0 j 1

            // cout << i << ' ' << j << ' ' << dp[i][j] << endl;
        }
    }
    cout << dp[0][0] << endl;
    return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;

typedef long long ll;
const int MAXN = 3e5 + 10;
const int Mod = 1e9 + 7;
int N;
char S[MAXN];
ll f[MAXN][2][2][3], s[MAXN];
ll ans;

int main() {
	register int i, j, k, l;
	scanf("%s", S + 1); N = strlen(S + 1);
	for(s[N + 1] = 1, i = N; i; --i) s[i] = s[i + 1] * (S[i] == '?' ? 2 : 1) % Mod;
	f[1][0][0][0] = 1;
	for(i = 1; i <= N; ++i) {
		if(S[i] != '1')
			for(j = 0; j < 2; ++j)
				for(k = 0; k < 2; ++k)
					for(l = 0; l < 3; ++l)
						(f[i + 1][j][k][(l & 1) + 1] += f[i][j][k][l]) %= Mod;
		if(S[i] != '0')
			for(j = 0; j < 2; ++j)
				for(k = 0; k < 2; ++k) {
					if(!j && !k) (f[i + 1][1][1][0] += f[i][j][k][0]) %= Mod;
					else if(j && k) (ans += 1ll * f[i][j][k][0] * s[i + 1]) %= Mod;
					else (f[i + 1][!j][k][0] += f[i][j][k][0]) %= Mod;
					(f[i + 1][j][k][0] += f[i][j][k][1]) %= Mod;
					(f[i + 1][!j][k][0] += f[i][j][k][2]) %= Mod;
				}
	}
	printf("%lld\n", (ans + f[N + 1][1][1][0]) % Mod);
	return 0;
}