#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);
mt19937 rng((int)chrono::steady_clock::now().time_since_epoch().count());
const int N = 2005;
long long n, p;
bool have[N][3];
string s;
bool solve() {
  bool ok = false;
  for (int i = 0; i < min(n - p, p); ++i) {
    if (have[i][0] && have[i][1]) {
      ok = true;
      for (int j = i; j < n; j += p)
        if (s[j] == '.') s[j] = '0';
    } else if (have[i][0]) {
      if (have[i][2]) {
        ok = true;
        for (int j = i; j < n; j += p) {
          if (s[j] == '.') s[j] = '1';
        }
      }
    } else if (have[i][1]) {
      if (have[i][2]) {
        ok = true;
        for (int j = i; j < n; j += p) {
          if (s[j] == '.') s[j] = '0';
        }
      }
    } else {
      s[i] = '1';
      for (int j = i + p; j < n; j += p) s[j] = '0';
      ok = true;
    }
  }
  for (int i = 0; i < n; ++i)
    if (s[i] == '.') s[i] = '0';
  return ok;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  cin >> n >> p >> s;
  for (int i = 0; i < n; ++i)
    if (s[i] != '.')
      have[i % p][s[i] - '0'] = true;
    else
      have[i % p][2] = true;
  if (solve())
    cout << s << "\n";
  else
    cout << "No"
         << "\n";
}
