#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
const int MAXN = 1e4 + 10;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double pi = acos(-1.0);
const double eps = 1e-6;
int dx[] = {0, -1, 0, 1};
int dy[] = {1, 0, -1, 0};
map<int, int> mymap, mymap1;
int n, m;
vector<int> Ve, Vo;
int save[200100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  int res = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x % 2) {
      if (!mymap[x]) {
        Vo.push_back(x);
        mymap[x] = 1;
        mymap1[x] = i;
      }
    } else {
      if (!mymap[x]) {
        Ve.push_back(x);
        mymap[x] = 1;
        mymap1[x] = i;
      }
    }
  }
  int o = Vo.size();
  int e = Ve.size();
  int r = -1;
  if (o >= n / 2 && e <= n / 2)
    r = min(o - n / 2, n / 2 - e);
  else if (o <= n / 2 && e >= n / 2)
    r = min(n / 2 - o, e - n / 2);
  if (r != -1) {
    res += r;
    if (o <= n / 2) {
      o += r;
      e -= r;
    } else {
      o -= r;
      e += r;
    }
  }
  res += max(n / 2 - o, 0);
  res += max(n / 2 - e, 0);
  for (int i = 1; i <= min(n, m); i++)
    if (i % 2) {
      if (!mymap[i]) {
        mymap[i] = 1;
        Vo.push_back(i);
      }
    } else {
      if (!mymap[i]) {
        mymap[i] = 1;
        Ve.push_back(i);
      }
    }
  o = Vo.size();
  e = Ve.size();
  if (o >= n / 2 && e >= n / 2) {
    cout << res << endl;
    vector<int> K;
    K.clear();
    for (int i = 0; i < n / 2; i++)
      if (mymap1[Vo[i]])
        save[mymap1[Vo[i]]] = Vo[i];
      else
        K.push_back(Vo[i]);
    for (int i = 0; i < n / 2; i++)
      if (mymap1[Ve[i]])
        save[mymap1[Ve[i]]] = Ve[i];
      else
        K.push_back(Ve[i]);
    int p = 1;
    int q = 0;
    while (p <= n && q < K.size())
      if (save[p])
        p++;
      else {
        save[p] = K[q];
        p++;
        q++;
      }
    for (int i = 1; i <= n; i++) cout << save[i] << ' ';
  } else
    cout << -1;
  return 0;
}
