#include <bits/stdc++.h>
using namespace std;
int n, m, a[600010], num[2], h[2];
bool flag[600010];
set<int> s;
int main() {
  scanf("%d%d", &n, &m);
  memset(flag, true, sizeof(flag));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (s.count(a[i]) == 0) {
      s.insert(a[i]);
      num[a[i] & 1]++;
    } else {
      flag[i] = false;
    }
  }
  int mid = n / 2;
  for (int j = 0; j < 2; j++) {
    if (num[j] > mid) {
      for (int i = 1; i <= n; i++) {
        if (flag[i] && ((a[i] & 1) == j)) {
          flag[i] = false;
          num[j]--;
        }
        if (num[j] <= mid) break;
      }
    }
  }
  s.clear();
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (flag[i]) s.insert(a[i]), ans++;
  }
  h[0] = 2, h[1] = 1;
  for (int j = 0; j < 2; j++) {
    if (num[j] < mid) {
      for (int i = 1; i <= n; i++) {
        if (flag[i]) continue;
        while (s.count(h[j]) > 0) h[j] += 2;
        if (h[j] > m) return puts("-1"), 0;
        num[j]++;
        a[i] = h[j];
        s.insert(a[i]);
        flag[i] = true;
        if (num[j] >= mid) break;
      }
    }
  }
  printf("%d\n", n - ans);
  for (int i = 1; i <= n; i++) {
    printf("%d ", a[i]);
  }
}
