#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e18 + 100;
const long long MOD = 1e9 + 7;
const long long N = 500;
const long long nul = 0;
const long long SIZE = 1e6 * 3;
const long double pi = atan2(0, -1);
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<vector<pair<char, long long> > > dict(k);
  for (long long i = 0; i < n; i++) {
    dict[i % k].push_back({s[i], i});
  }
  bool flag = 1;
  for (long long i = 0; i < k; i++) {
    vector<long long> cnt;
    for (auto j : dict[i]) {
      if (j.first == '.') cnt.push_back(j.second);
    }
    if (cnt.size() >= 2) {
      for (long long j = 0; j < n; j++) {
        if (s[j] == '.' && j == cnt[0])
          s[j] = '1';
        else if (s[j] == '.')
          s[j] = '0';
      }
      flag = 0;
      break;
    }
    set<char> exist;
    long long ind = -1;
    for (auto j : dict[i]) {
      if (j.first != '.') {
        exist.insert(j.first);
        ind = j.second;
      }
    }
    if (exist.size() > 1) {
      for (long long j = 0; j < n; j++) {
        if (s[j] == '.') s[j] = '1';
      }
      flag = 0;
      break;
    } else if (ind != -1 && cnt.size() > 0) {
      char now = '0';
      if (s[ind] == '0') now = '1';
      for (long long j = 0; j < n; j++) {
        if (j == cnt[0])
          s[j] = now;
        else if (s[j] == '.')
          s[j] = '0';
      }
      flag = 0;
      break;
    }
  }
  if (flag) {
    cout << "No\n";
  } else {
    cout << s << endl;
  }
}
