#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  int n, p;
  cin >> n >> p;
  string s;
  cin >> s;
  vector<char> v(n + 1);
  for (int i = 1; i <= n; i++) {
    v[i] = s[i - 1];
  }
  int can = n - p;
  int cnt = 0;
  for (int i = 1; i <= can; i++) {
    char c = v[i];
    char x = v[i + p];
    if (c == x && c != '.' && x != '.') {
      cnt++;
    }
    if (c == x && c == '.' && x == '.') {
      v[i] = '1';
      v[i + p] = '0';
    }
    if (c == '.' && x == '1') {
      v[i] = '0';
    } else if (c == '.' && x == '0')
      v[i] = '1';
    else if (c == '1' && x == '.')
      v[i + p] = '0';
    else if (c == '0' && x == '.')
      v[i + p] = '1';
  }
  if (cnt == can) {
    cout << "NO\n";
    return 0;
  }
  for (long long int i = 1; i < v.size(); i++) {
    if (v[i] == '.')
      cout << '1';
    else
      cout << v[i];
  }
  cout << endl;
  return 0;
}
