#include <bits/stdc++.h>
using namespace std;
string solve(int N, int P, string S) {
  for (int j = 0; j < P; ++j) {
    int cnt[3] = {0, 0, 0};
    for (int i = j; i < N; i += P) {
      if (S[i] == '0')
        cnt[0]++;
      else if (S[i] == '1')
        cnt[1]++;
      else if (S[i] == '.')
        cnt[2]++;
    }
    if (cnt[2] > 0) {
      for (int i = j, m = 0; i < N; i += P) {
        if (S[i] == '.') {
          if (cnt[0] == 0 && cnt[1] == 0) {
            if (m & 1)
              S[i] = '0';
            else
              S[i] = '1';
            ++m;
          } else if (cnt[0] == 0)
            S[i] = '0';
          else
            S[i] = '1';
        }
      }
    }
  }
  bool ok = false;
  for (int j = 0; j < P; ++j) {
    int cnt[3] = {0, 0, 0};
    for (int i = j; i < N; i += P) {
      if (S[i] == '0')
        cnt[0]++;
      else
        cnt[1]++;
    }
    if (cnt[0] != 0 && cnt[1] != 0) {
      ok = true;
      break;
    }
  }
  return ok ? S : "No";
}
int main() {
  int N, P;
  cin >> N >> P;
  string S;
  cin >> S;
  cout << solve(N, P, S) << endl;
  return 0;
}
