#include <bits/stdc++.h>
using namespace std;
char s[2005 + 1];
int N, P;
int main() {
  int i, j, my, ok = 0, cnt;
  scanf("%d %d\n", &N, &P);
  scanf("%s", s);
  for (i = N; i >= 1; --i) s[i] = s[i - 1];
  for (i = 1; i <= P && !ok; ++i) {
    my = -1;
    cnt = 0;
    for (j = i; j <= N; j += P)
      if (s[j] != '.' && my == -1)
        my = s[j];
      else if (s[j] != '.' && my != s[j])
        ok = 1;
      else if (s[j] == '.')
        ++cnt;
    if (cnt > 1) {
      ok = 1;
      for (j = i; j <= N; j += P)
        if (s[j] == '.') {
          s[j] = '0';
          break;
        }
      for (j += P; j <= N; j += P)
        if (s[j] == '.') {
          s[j] = '1';
          break;
        }
    } else if (my != -1) {
      for (j = i; j <= N; j += P)
        if (s[j] == '.') s[j] = '1' - (my - '0'), ok = 1;
    }
  }
  for (i = 1; i <= N; ++i)
    if (s[i] == '.') s[i] = '0';
  for (i = 0; i < N; ++i) s[i] = s[i + 1];
  s[N] = '\0';
  if (ok)
    printf("%s\n", s);
  else
    printf("No\n");
  return 0;
}
