#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
int numbers[2];
vector<int> arr, t;
map<int, bool> vis;
int main() {
  cin >> n >> m;
  for (int i = 1, x; i <= n; ++i) {
    cin >> x;
    arr.emplace_back(x);
    if (vis[x] || numbers[x % 2] == n / 2)
      t.push_back(i - 1);
    else {
      numbers[x % 2]++;
      vis[x] = true;
    }
  }
  int p = 0;
  for (int i = 1; i <= m; ++i) {
    if (p == t.size()) break;
    if (!vis[i]) {
      if (numbers[i % 2] < n / 2) {
        arr[t[p++]] = i;
        numbers[i % 2]++;
      }
    }
  }
  if (p < t.size()) {
    cout << -1;
    return 0;
  }
  cout << t.size() << endl;
  for (int i = 0; i < n; ++i) cout << arr[i] << " ";
  cin >> n;
  return 0;
}
