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