#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  cin >> n >> p;
  string s;
  cin >> s;
  int numIntervals = n / p + (n % p ? 1 : 0);
  set<int> contentCandidates[p];
  for (int i = 0; i < p; ++i) {
    for (int k = 0; k < numIntervals; ++k) {
      int coord = i + k * p;
      if (coord < n) {
        if (s[coord] != '.') {
          contentCandidates[i].insert(s[coord]);
        }
      }
    }
  }
  for (int i = 0; i < p; ++i) {
    for (int k = 0; k < numIntervals; ++k) {
      int coord = i + k * p;
      if (coord < n) {
        if (s[coord] == '.' && !contentCandidates[i].empty()) {
          s[coord] = (*contentCandidates[i].begin() == '1' ? '0' : '1');
          contentCandidates[i].insert(s[coord]);
        }
      }
    }
  }
  bool found = false;
  for (int i = 0; i < p; ++i) {
    if (contentCandidates[i].size() > 1) {
      found = true;
      break;
    } else if (contentCandidates[i].size() == 0) {
      vector<int> coords;
      for (int k = 0; k < numIntervals; ++k) {
        int coord = i + k * p;
        if (coord < n) {
          coords.push_back(coord);
        }
      }
      if (coords.size() > 1) {
        s[coords[0]] = '1';
        s[coords[1]] = '0';
        found = true;
        break;
      }
    }
  }
  if (found) {
    for (int i = 0; i < n; ++i) {
      if (s[i] == '.') {
        s[i] = '0';
      }
    }
    cout << s << endl;
  } else
    cout << "No" << endl;
  return 0;
}
