#include <bits/stdc++.h>
using namespace std;
struct cell {
  int v, id;
  cell() {}
  cell(int _v, int _id) {
    v = _v;
    id = _id;
  }
} ara[2 * 100010];
int n, m, slct, dif, res[2 * 100010];
map<int, int> mp;
bool compare(cell lhs, cell rhs) {
  if (mp[lhs.v] == mp[rhs.v]) {
    return lhs.v < rhs.v;
  }
  return mp[lhs.v] > mp[rhs.v];
}
void input() {
  int i, j, k, odd = 0, even = 0;
  scanf("%d %d", &n, &m);
  mp.clear();
  for (i = 0; i < n; i++) {
    scanf("%d", &ara[i].v);
    ara[i].id = i;
    mp[ara[i].v]++;
    if (ara[i].v % 2 == 0) {
      even++;
    } else {
      odd++;
    }
  }
  if (odd >= even) {
    slct = 1;
    dif = odd - even;
  } else {
    slct = 0;
    dif = even - odd;
  }
  sort(ara, ara + n, compare);
}
int solve() {
  int i, j, k, temp[2], cnt = 0;
  temp[0] = 2;
  temp[1] = 1;
  for (i = 0; i < n; i++) {
    if (i == 0) {
      continue;
    }
    if (ara[i].v == ara[i - 1].v) {
      if (dif > 0) {
        while (temp[!slct] <= m) {
          if (!mp[temp[!slct]]) {
            res[ara[i].id] = temp[!slct];
            mp[ara[i].v]--;
            mp[temp[!slct]]++;
            cnt++;
            if (ara[i].v % 2 == slct) {
              dif -= 2;
            }
            break;
          }
          temp[!slct] += 2;
        }
        if (temp[!slct] > m) {
          return -1;
        }
      } else {
        int s = ara[i].v % 2;
        while (temp[s] <= m) {
          if (!mp[temp[s]]) {
            res[ara[i].id] = temp[s];
            mp[ara[i].v]--;
            mp[temp[s]]++;
            cnt++;
            break;
          }
          temp[s] += 2;
        }
        if (temp[s] > m) {
          return -1;
        }
      }
    }
  }
  temp[0] = 2;
  temp[1] = 1;
  for (i = 0; i < n; i++) {
    if (i != 0 && ara[i].v == ara[i - 1].v) {
      continue;
    } else if (dif > 0 && ara[i].v % 2 == slct) {
      while (temp[!slct] <= m) {
        if (!mp[temp[!slct]]) {
          res[ara[i].id] = temp[!slct];
          mp[ara[i].v]--;
          mp[temp[!slct]]++;
          dif -= 2;
          cnt++;
          break;
        }
        temp[!slct] += 2;
      }
      if (temp[!slct] > m) {
        return -1;
      }
    } else {
      res[ara[i].id] = ara[i].v;
    }
  }
  return cnt;
}
int main() {
  int i, j, k;
  input();
  int s = solve();
  if (s == -1) {
    printf("%d", -1);
  } else {
    printf("%d", s);
    puts("");
    for (i = 0; i < n; i++) {
      if (i == 0) {
        printf("%d", res[i]);
      } else {
        printf(" ");
        printf("%d", res[i]);
      }
    }
  }
  puts("");
  return 0;
}
