#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<int> odd, even, nv, ans;
  set<int> s;
  vector<pair<int, int> > a(n);
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> a[i].first;
    s.insert(a[i].first);
    a[i].second = i;
  }
  int co = 0, ce = 0, re = n >> 1;
  for (auto it : s) {
    if (it & 1) {
      if (co == re) continue;
      co++;
      odd.push_back(it);
    } else {
      if (ce == re) continue;
      ce++;
      even.push_back(it);
    }
  }
  int i = 0, j = 0, pe = 0, po = -1, cce = 0, cco = 0;
  while (i < co || j < ce) {
    if (i < co) {
      if (co + cco < re) {
        if (po < odd[i] - 2) {
          po += 2;
          if (po > m) {
            cout << -1;
            return 0;
          }
          nv.push_back(po);
          cco++;
        } else {
          ans.push_back(odd[i]);
          po = odd[i];
          i++;
        }
      } else {
        ans.push_back(odd[i]);
        po = odd[i];
        i++;
      }
    }
    if (j < ce) {
      if (ce + cce < re) {
        if (pe < even[j] - 2) {
          pe += 2;
          if (pe > m) {
            cout << -1;
            return 0;
          }
          nv.push_back(pe);
          cce++;
        } else {
          ans.push_back(even[j]);
          pe = even[j];
          j++;
        }
      } else {
        ans.push_back(even[j]);
        pe = even[j];
        j++;
      }
    }
  }
  co += cco;
  ce += cce;
  while (co < re) {
    int v = po + 2;
    if (v > m) {
      cout << -1;
      return 0;
    }
    nv.push_back(v);
    po = v;
    co++;
  }
  while (ce < re) {
    int v = pe + 2;
    if (v > m) {
      cout << -1;
      return 0;
    }
    nv.push_back(v);
    pe = v;
    ce++;
  }
  sort((ans).begin(), (ans).end());
  sort((a).begin(), (a).end());
  int sz = ans.size();
  vector<int> c(n);
  j = 0;
  int cnt = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    int v = a[i].first;
    int in = lower_bound((ans).begin(), (ans).end(), (v)) - (ans).begin();
    ;
    if (in == sz || ans[in] != v) {
      a[i].first = nv[j++];
      cnt++;
      continue;
    } else if (i < n - 1 && a[i].first == a[i + 1].first) {
      a[i].first = nv[j++];
      cnt++;
      continue;
    }
  }
  cout << cnt << endl;
  for (int(i) = 0; (i) < (n); (i)++) c[a[i].second] = a[i].first;
  for (int(i) = 0; (i) < (n); (i)++) cout << c[i] << ' ';
  cout << endl;
  return 0;
}
