#include <bits/stdc++.h>
using namespace std;
inline void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  multiset<int> e1, o1, e2, o2, e3, o3;
  for (int i = 0; i < n; i++)
    if (v[i] % 2)
      o1.insert(v[i]);
    else
      e1.insert(v[i]);
  int esz = e1.size(), osz = o1.size();
  int o = 1;
  int e = 2;
  while (e1.size()) {
    int cur = *e1.begin();
    e1.erase(e1.begin());
    if (e1.size() && cur == *e1.begin() && esz <= osz) {
      while (e1.find(e) != e1.end() || e2.find(e) != e2.end()) e += 2;
      if (e > m) {
        cout << -1;
        return;
      }
      e2.insert(e);
    } else if (e1.size() && cur == *e1.begin() && esz > osz) {
      while (o1.find(o) != o1.end() || o2.find(o) != o2.end()) o += 2;
      if (o > m) {
        cout << -1;
        return;
      }
      o2.insert(o);
      osz++;
      esz--;
    } else
      e2.insert(cur);
  }
  while (o1.size()) {
    int cur = *o1.begin();
    o1.erase(o1.begin());
    if (o1.size() && cur == *o1.begin() && osz <= esz) {
      while (o1.find(o) != o1.end() || o2.find(o) != o2.end()) o += 2;
      if (o > m) {
        cout << -1;
        return;
      }
      o2.insert(o);
    } else if (o1.size() && cur == *o1.begin() && esz < osz) {
      while (e1.find(e) != e1.end() || e2.find(e) != e2.end()) e += 2;
      if (e > m) {
        cout << -1;
        return;
      }
      e2.insert(e);
      esz++;
      osz--;
    } else
      o2.insert(cur);
  }
  while (o2.size()) {
    int cur = *o2.begin();
    o2.erase(o2.begin());
    if (osz > esz) {
      while (e2.find(e) != e2.end() || e3.find(e) != e3.end()) e += 2;
      if (e > m) {
        cout << -1;
        return;
      }
      e3.insert(e);
      esz++;
      osz--;
    } else
      o3.insert(cur);
  }
  while (e2.size()) {
    int cur = *e2.begin();
    e2.erase(e2.begin());
    if (esz > osz) {
      while (o2.find(o) != o2.end() || o3.find(o) != o3.end()) o += 2;
      if (o > m) {
        cout << -1;
        return;
      }
      o3.insert(o);
      esz--;
      osz++;
    } else
      e3.insert(cur);
  }
  vector<int> otv(n, -1);
  for (int i = 0; i < n; i++) {
    if (v[i] % 2 == 1 && o3.find(v[i]) != o3.end()) {
      otv[i] = v[i];
      o3.erase(v[i]);
    } else if (v[i] % 2 == 0 && e3.find(v[i]) != e3.end()) {
      otv[i] = v[i];
      e3.erase(v[i]);
    }
  }
  int f = 0;
  for (int i = 0; i < n; i++) {
    if (otv[i] == -1) {
      f++;
      if (e3.size()) {
        otv[i] = *e3.begin();
        e3.erase(e3.begin());
      } else if (o3.size()) {
        otv[i] = *o3.begin();
        o3.erase(o3.begin());
      }
    }
  }
  cout << f << '\n';
  for (int i = 0; i < n; i++) cout << otv[i] << ' ';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q = 1;
  for (; q > 0; q--) {
    solve();
    cout << '\n';
  }
}
