#include <bits/stdc++.h>
using namespace std;
int n, m, now;
int cnt[2];
int s[200010];
map<int, int> Q;
vector<int> P;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s[i]);
    if (Q.count(s[i]) || cnt[s[i] % 2] == n / 2)
      P.push_back(i);
    else {
      cnt[s[i] % 2]++;
      Q[s[i]] = 1;
    }
  }
  now = 0;
  for (int i = 1; i <= m && now < P.size(); i++) {
    if (cnt[i % 2] == n / 2 || Q.count(i)) continue;
    s[P[now]] = i;
    now++;
    cnt[i % 2]++;
  }
  if (cnt[0] != n / 2 || cnt[1] != n / 2)
    puts("-1");
  else {
    printf("%d\n", now);
    for (int i = 1; i <= n; i++) printf("%d ", s[i]);
    puts("");
  }
  return 0;
}
