#include <bits/stdc++.h>
using namespace std;
const long long N = 2e3;
vector<pair<long long, long long>> poses[N];
bool used[N][N];
long long c = 0;
signed main() {
  long long n, p;
  cin >> n >> p;
  string s;
  cin >> s;
  long long t = '.';
  for (long long t = 0; t < n; t++) {
    poses[t % p].push_back({s[t], t});
  }
  for (long long i = 0; i < p; i++) {
    if (i + p < n) {
      sort(poses[i].begin(), poses[i].end());
      reverse(poses[i].begin(), poses[i].end());
      for (long long j = 0; j < poses[i].size(); j++) {
        if (poses[i][j].first == '0') {
          used[c]['0'] = 1;
        }
        if (poses[i][j].first == '1') {
          used[c]['1'] = 1;
        }
        if (poses[i][j].first == '.') {
          if (!used[c]['0']) {
            s[poses[i][j].second] = '0';
            used[c]['0'] = 1;
          } else {
            s[poses[i][j].second] = '1';
            used[c]['1'] = 1;
          }
        }
      }
      c++;
    }
  }
  for (long long g = 0; g < s.size(); g++)
    if (s[g] == '.') s[g] = '1';
  for (long long i = 0; i < p; i++) {
    long long summ = 0;
    long long c = 0;
    for (long long i1 = i; i1 < n; i1 += p) {
      summ += s[i1] - 48;
      c++;
    }
    if ((summ % c)) {
      cout << s << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
