#include <bits/stdc++.h>
using namespace std;
vector<int> V;
map<int, int> vis, cnt, a;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (vis[a[i]] || cnt[a[i] & 1] == n / 2)
      V.push_back(i);
    else {
      vis[a[i]] = 1;
      cnt[a[i] & 1]++;
    }
  }
  int p = 0;
  for (int i = 1; i <= m; i++) {
    if (p == V.size()) break;
    if (vis[i]) continue;
    if (cnt[i & 1] < n / 2) {
      cnt[i & 1]++;
      a[V[p++]] = i;
    }
  }
  if (p < V.size())
    cout << "-1" << endl;
  else {
    cout << p << endl;
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
