#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn], used[maxn], change[maxn];
int n, m, odd, even, sz, ans;
int o = 0, e = 0;
map<int, int> id;
int num[maxn];
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] % 2 == 0)
      even++;
    else
      odd++;
    if (!id[a[i]]) id[a[i]] = ++sz;
    num[id[a[i]]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (num[id[a[i]]] > 1) {
      change[i] = true;
      num[id[a[i]]]--;
      if (a[i] % 2 == 0)
        even--;
      else
        odd--;
      ans++;
    }
  }
  for (int i = 1; i <= n; i++)
    if (!change[i]) {
      if (odd > n / 2 && a[i] % 2 == 1) {
        change[i] = true;
        num[id[a[i]]]--;
        odd--;
        ans++;
      } else if (even > n / 2 && a[i] % 2 == 0) {
        change[i] = true;
        num[id[a[i]]]--;
        even--;
        ans++;
      }
    }
  for (int i = 1; i <= n; i++)
    if (change[i]) {
      if (odd < n / 2) {
        if (o == 0) o = 1;
        while (id[o]) o += 2;
        a[i] = o;
        id[o] = ++sz;
        odd++;
      } else if (even < n / 2) {
        if (e == 0) e = 2;
        while (id[e]) e += 2;
        a[i] = e;
        id[e] = ++sz;
        even++;
      }
    }
  if (o > m || e > m)
    printf("-1\n");
  else {
    printf("%d\n", ans);
    for (int i = 1; i <= n; i++) {
      printf("%d ", a[i]);
    }
    puts("");
  }
  return 0;
}
