#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, m;
int a[N];
set<int> s;
int odd, even;
map<int, int> mp;
int r[N];
int main(int argc, char **argv) {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    if (++mp[a[i]] <= 1) {
      if (a[i] > m) {
        s.insert(a[i]);
        if (a[i] & 1)
          ++odd;
        else
          ++even;
      }
    }
  }
  if ((int)s.size() + m < n) return !printf("-1");
  odd += m / 2;
  even += m / 2;
  if (m & 1) ++odd;
  if (odd < n / 2 || even < n / 2) return !printf("-1");
  odd = even = 0;
  int idx = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] & 1)
      ++odd;
    else
      ++even;
    if (mp[a[i]] > 1) {
      r[idx++] = i;
      --mp[a[i]];
    }
  }
  m = min(m, n);
  vector<int> o, e;
  for (int i = 1; i <= m; i += 2) {
    if (mp[i] == 0) o.push_back(i);
  }
  for (int i = 2; i <= m; i += 2)
    if (mp[i] == 0) e.push_back(i);
  int ans = 0;
  for (int i = 0; i < idx; ++i) {
    if (a[r[i]] & 1) {
      if (odd > even) {
        ++ans;
        a[r[i]] = e.back();
        e.pop_back();
        --odd;
        ++even;
      } else if (odd <= even) {
        ++ans;
        a[r[i]] = o.back();
        o.pop_back();
      }
    } else {
      if (even > odd) {
        ++ans;
        a[r[i]] = o.back();
        o.pop_back();
        ++odd;
        --even;
      } else if (odd >= even) {
        ++ans;
        a[r[i]] = e.back();
        e.pop_back();
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (odd > even && (a[i] & 1)) {
      a[i] = e.back();
      e.pop_back();
      --odd;
      ++even;
      ++ans;
    }
    if (even > odd && (a[i] % 2 == 0)) {
      a[i] = o.back();
      o.pop_back();
      ++odd;
      --even;
      ++ans;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < n; ++i) printf("%d ", a[i]);
  return 0;
}
