#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, p;
  string s;
  cin >> n >> p >> s;
  for (int i = 0; i < n - p; i++) {
    bool ok = false;
    if (s[i] == '.' && s[i + p] != '.')
      s[i] = abs(s[i + p] - '0' - 1) + '0', ok = true;
    if (s[i] != '.' && s[i + p] == '.')
      s[i + p] = abs(s[i] - '0' - 1) + '0', ok = true;
    if (s[i] == '.' && s[i + p] == '.') {
      s[i] = '0';
      s[i + p] = '1';
      ok = true;
    }
    if (s[i] != '.' && s[i + p] != '.' && s[i] != s[i + p]) ok = true;
    if (ok == true) {
      for (int j = 0; j < n; j++) {
        if (s[j] == '.') {
          cout << 0;
        } else {
          cout << s[j];
        }
      }
      return 0;
    }
  }
  return !(cout << "NO");
}
