#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
const long long MOD = 998244353;
void solve() {
  long long n, p;
  string s;
  cin >> n >> p >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.') {
      if (i + p < n) {
        if (s[i + p] == '.') {
          s[i] = '0', s[i + p] = '1';
          break;
        } else {
          if (s[i + p] == '1')
            s[i] = '0';
          else
            s[i] = '1';
          break;
        }
      }
    } else {
      if (i + p < n) {
        if (s[i + p] == '.') {
          if (s[i] == '0')
            s[i + p] = '1';
          else
            s[i + p] = '0';
        }
        if (s[i + p] != s[i]) break;
      }
    }
  }
  for (long long i = 0; i < n; i++)
    if (s[i] == '.') s[i] = '0';
  for (long long i = 0; i < s.length() - p; i++) {
    if (s[i] != s[i + p]) {
      cout << s;
      return;
    }
  }
  cout << "No";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) solve();
  return 0;
}
