#include <bits/stdc++.h>
using namespace std;
int sz, p;
string str, ans;
bool f(int id, char S) {
  bool ANS = true;
  id = id + p;
  for (; id < str.size(); id = id + p) {
    if (str[id] == '.') {
      ANS = false;
      if (S == '0') {
        ans[(int)id] = '1';
      } else {
        ans[id] = '0';
      }
    } else if (S == '0') {
      if (str[id] == '1') {
        ANS = false;
      }
    } else {
      if (str[id] == '0') {
        ANS = false;
      }
    }
  }
  return ANS;
}
int main() {
  while (cin >> sz >> p >> str) {
    ans = str;
    bool flag = true;
    for (int i = 0; i < min(p, (int)str.size()); i++) {
      if (str[i] == '.') {
        if (!f(i, '0')) {
          ans[i] = '0';
          flag = false;
        } else if (!f(i, '1')) {
          ans[i] = '1';
          flag = false;
        }
      } else {
        flag = flag and f(i, str[i]);
      }
    }
    for (int i = 0; i < str.size(); i++) {
      if (ans[i] == '.') ans[i] = '0';
    }
    if (flag) {
      cout << "No\n";
    } else {
      cout << ans << "\n";
    }
  }
  return 0;
}
