#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(n);
  int odd = 0, even = 0;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mp[v[i]]++;
    if (v[i] % 2)
      odd++;
    else
      even++;
  }
  auto o = v;
  int first_even = 2, first_odd = 1;
  for (auto &i : v) {
    if (mp[i] > 1) {
      mp[i]--;
      if (i % 2) {
        if (odd <= even) {
          while (mp[first_odd]) first_odd += 2;
          if (first_odd > m) {
            cout << -1;
            return 0;
          }
          mp[first_odd]++;
          i = first_odd, first_odd += 2;
        } else {
          while (mp[first_even]) first_even += 2;
          if (first_even > m) {
            cout << -1;
            return 0;
          }
          odd--, even++;
          mp[first_even]++;
          i = first_even, first_even += 2;
        }
      } else {
        if (even <= odd) {
          while (mp[first_even]) first_even += 2;
          if (first_even > m) {
            cout << -1;
            return 0;
          }
          mp[first_even]++;
          i = first_even, first_even += 2;
        } else {
          while (mp[first_odd]) first_odd += 2;
          if (first_odd > m) {
            cout << -1;
            return 0;
          }
          mp[first_odd]++;
          even--, odd++;
          mp[first_odd]++;
          i = first_odd, first_odd += 2;
        }
      }
    }
  }
  for (auto &i : v) {
    if (odd == even) break;
    if (i % 2) {
      if (even > odd) continue;
      while (mp[first_even]) first_even += 2;
      if (first_even > m) {
        cout << -1;
        return 0;
      }
      mp[first_even]++;
      i = first_even, first_even += 2;
      odd--, even++;
    } else {
      if (odd > even) continue;
      while (mp[first_odd]) first_odd += 2;
      if (first_odd > m) {
        cout << -1;
        return 0;
      }
      mp[first_odd]++;
      i = first_odd, first_odd += 2;
      even--, odd++;
    }
  }
  if (odd == even) {
    int ans = 0;
    for (int i = 0; i < v.size(); i++)
      if (v[i] != o[i]) ans++;
    cout << ans << '\n';
    for (auto i : v) cout << i << " ";
  } else
    cout << -1;
}
