#include <bits/stdc++.h>
using std::cerr;
using std::make_tuple;
using std::pair;
using std::vector;
int order[200010];
int print[200010];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  std::map<int, int> map;
  std::set<int> set;
  int odd = 0, even = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    order[i] = a;
    map[a]++;
    if (a % 2 == 0)
      even++;
    else
      odd++;
  }
  int change = 0;
  for (auto p : map) {
    change += p.second - 1;
    if (p.first % 2 == 0)
      even -= p.second - 1;
    else
      odd -= p.second - 1;
  }
  if (odd > n / 2) {
    change += odd - (n / 2);
    odd = n / 2;
  }
  if (even > n / 2) {
    change += even - (n / 2);
    even = n / 2;
  }
  int e = 0;
  int o = 0;
  for (auto p : map) {
    if (p.first % 2 == 0) {
      if (even) {
        set.insert(p.first);
        even--;
        e++;
      }
    }
    if (p.first % 2 == 1) {
      if (odd) {
        set.insert(p.first);
        odd--;
        o++;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    if (set.size() == n) break;
    if (!set.count(i)) {
      if (i % 2 == 0 && e < n / 2) {
        set.insert(i);
        e++;
      }
      if (i % 2 == 1 && o < n / 2) {
        set.insert(i);
        o++;
      }
    }
  }
  if (e == n / 2 && o == n / 2) {
    printf("%d\n", change);
    for (int i = 0; i < n; i++) {
      if (set.count(order[i])) {
        set.erase(order[i]);
        print[i] = order[i];
      }
    }
    int idx = 0;
    for (int p : set) {
      while (print[idx] != 0) idx++;
      print[idx] = p;
    }
    for (int i = 0; i < n; i++) {
      printf("%d ", print[i]);
    }
  } else {
    printf("-1");
  }
}
