#include <bits/stdc++.h>
using namespace std;
int dir[] = {0, 1, 0, -1, 1, 0, -1, 0};
void solve() {
  int n, p;
  string s;
  cin >> n >> p >> s;
  bool check = true;
  for (int i = 0; i < n - p; i++) {
    if (s[i] == '.' || s[i + p] != s[i]) {
      check = false;
      break;
    }
  }
  if (check) {
    cout << "No" << endl;
    return;
  }
  for (long long int i = 0; i < n - p; i++) {
    if (s[i] == '.' && s[i + p] != '0')
      s[i] = '0';
    else if (s[i] == '.' && s[i + p] == '0')
      s[i] = '1';
  }
  for (int i = n - p; i < p; i++) {
    if (s[i] == '.') s[i] = '0';
  }
  for (int i = p; i < n; i++) {
    if (s[i] == '.') {
      s[i] = (s[i - p] == '0') ? '1' : '0';
    }
  }
  cout << s << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  int t = 1;
  for (int cn = 1; cn <= t; cn++) {
    solve();
  }
  return 0;
}
