#include <bits/stdc++.h>
using namespace std;
inline namespace Infinity {
inline namespace Constant {
constexpr const int eof = EOF;
constexpr const int maxint = INT_MAX;
constexpr const long long maxll = LLONG_MAX;
constexpr const double eps = DBL_EPSILON;
}  // namespace Constant
inline namespace TypeDefine {
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
template <typename T = int>
using Pair = pair<T, T>;
template <typename T = int>
using PairList = vector<Pair<T>>;
template <typename T = vector<int>>
using Iter = typename T::iterator;
}  // namespace TypeDefine
inline namespace IO {
const char LF = '\n';
const char SP = ' ';
int dbl_prec = 10;
int ldbl_prec = 18;
inline void write(const int n) { printf("%d", n); }
inline void write(const unsigned n) { printf("%u", n); }
inline void write(const int64_t n) { printf("%" PRId64, n); }
inline void write(const uint64_t n) { printf("%" PRIu64, n); }
inline void write(const double a) { printf("%.*f", dbl_prec, a); }
inline void write(const long double a) { printf("%.*Lf", ldbl_prec, a); }
inline void write(const char c) { printf("%c", c); }
inline void write(const char s[]) { printf("%s", s); }
inline void write(const string &s) { printf("%s", s.data()); }
template <typename T>
inline void writeSP(const T a) {
  write(a);
  write(SP);
}
template <typename T, typename U>
inline void write(const pair<T, U> &p) {
  writeSP(p.first);
  write(p.second);
}
template <class T>
inline void write(const T a) {
  for (auto i = a.begin(); i != a.end(); i++) {
    if (i != a.begin()) write(SP);
    write(*i);
  }
}
template <typename T>
inline void write(initializer_list<T> list) {
  for (auto i = list.begin(); i != list.end(); i++) {
    if (i != list.begin()) write(SP);
    write(*i);
  }
}
template <typename T>
inline void writer(T begin, T end) {
  for (write(*begin++); begin != end; ++begin) write(SP), write(*begin);
}
inline void writeln() { write(LF); }
inline void writeSP() { write(SP); }
template <typename T>
inline void writeln(const T &a) {
  write(a);
  write(LF);
}
template <typename T>
inline void writeln(initializer_list<T> list) {
  for (auto i = list.begin(); i != list.end(); i++) {
    if (i != list.begin()) write(SP);
    write(*i);
  }
  write(LF);
}
template <class T>
inline void writelns(const T &a) {
  for (auto n : a) writeln(n);
}
template <typename T, typename... types>
inline void write(const T &a, const types &...args) {
  write(a);
  write(args...);
}
template <typename... types>
inline void writeln(const types &...args) {
  write(args...);
  write(LF);
}
template <typename... types>
inline void writeSP(const types &...args) {
  write(args...);
  write(SP);
}
inline void writelnYN(bool b) { writeln(b ? "YES" : "NO"); }
inline void writelnyn(bool b) { writeln(b ? "Yes" : "No"); }
string caseN(int n, bool sharp = true, bool space = true) {
  return string("Case ") + (sharp ? "#" : "") + to_string(n) + ":" +
         (space ? " " : "");
}
inline int read(int &n) { return scanf("%d", &n); }
inline int read(int64_t &n) { return scanf("%" SCNd64, &n); }
inline char getcc() {
  char c;
  do c = getchar();
  while (isspace(c));
  return c;
}
inline int getint() {
  int n;
  read(n);
  return n;
}
inline int64_t getll() {
  int64_t n;
  read(n);
  return n;
}
inline double getdbl() {
  double n;
  scanf("%lf", &n);
  return n;
}
inline pair<int, int> getpair() {
  pair<int, int> p;
  scanf("%d%d", &p.first, &p.second);
  return p;
}
inline vector<int> getints(int n) {
  vector<int> v(n);
  for (int &i : v) i = getint();
  return v;
}
inline vector<pair<int, int>> getpairs(int n) {
  vector<pair<int, int>> v(n);
  for (pair<int, int> &p : v) {
    p = getpair();
  }
  return v;
}
inline void read(string &str, unsigned size) {
  char s[++size];
  scanf("%s", s);
  str.assign(s);
}
inline string getstr(unsigned size = 0x100000) {
  string s;
  read(s, size);
  return s;
}
inline string getln(unsigned size = 0x100000) {
  char s[++size];
  scanf("%[^\n]", s);
  getchar();
  return s;
}
}  // namespace IO
inline namespace BattleLab {
class Range {
  class RangeIterator {
   public:
    RangeIterator(int current = 0, int step = 1)
        : current(current), step(step) {}
    bool operator!=(const RangeIterator &iterator) const {
      return current < iterator.current;
    }
    int operator*() const { return current; }
    RangeIterator operator++() { return {current += step, step}; }

   protected:
    int current, step;
  };

 public:
  Range(int to, int from = 0, int step = 1) : from(from), to(to), step(step) {}
  RangeIterator begin() const { return {from, step}; }
  RangeIterator end() const { return {to, step}; }

 protected:
  int from, to, step;
};
Range range(int to) { return {to}; }
Range range(int from, int to) { return {to, from}; }
Range range(int from, int to, int step) { return {to, from, step}; }
}  // namespace BattleLab
inline namespace Miscelleneous {
inline constexpr int ctoi(const char c) { return c - '0'; }
inline constexpr char itoc(const int n) { return n + '0'; }
inline int dtoi(const double d) { return round(d); }
template <typename T>
inline constexpr bool in(T x, T l, T r) {
  return l <= x && x <= r;
}
template <typename T>
inline constexpr T tristate(int val, T nag, T zero, T pos) {
  return val > 0 ? pos : val < 0 ? nag : zero;
}
template <class T>
inline int size(const T &a) {
  return a.size();
}
template <class T>
inline void sort(T &a) {
  sort(a.begin(), a.end());
}
template <class T1, class T2>
inline void sort(T1 &a, T2 comp) {
  sort(a.begin(), a.end(), comp);
}
template <class T1, typename T2>
inline int lbound(const T1 &a, const T2 k) {
  return lower_bound(a.begin(), a.end(), k) - a.begin();
}
template <class T1, typename T2>
inline int ubound(const T1 &a, const T2 k) {
  return upper_bound(a.begin(), a.end(), k) - a.begin();
}
template <class T1, class T2>
inline int count(T1 &a, T2 k) {
  return ubound(a, k) - lbound(a, k);
}
template <typename T>
inline void clear(T &a) {
  memset(a, 0, sizeof a);
}
template <typename T>
T gcd(T a, T b) {
  while (b) {
    T t = a % b;
    a = b;
    b = t;
  }
  return a;
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
long long qpow(long long a, long long b, long long c) {
  return b ? qpow(a * a % c, b >> 1, c) * (b & 1 ? a : 1) % c : 1;
}
template <typename T>
T exGcd(T a, T b, T &x, T &y) {
  T d = a;
  if (b) {
    d = exGcd(b, a % b, y, x);
    y -= a / b * x;
  } else {
    x = 1;
    y = 0;
  }
  return d;
}
template <typename T>
inline constexpr T mps(T l, T r, T k) {
  return ((r - (r % k + k) % k) - (l + (k - l % k) % k)) / k + 1;
}
template <typename T>
inline constexpr T sgn(T a) {
  return a ? a > 0 ? 1 : -1 : 0;
}
template <typename T>
inline constexpr T sq(T a) {
  return a * a;
}
template <typename T>
inline constexpr bool odd(T a) {
  return bool(a % 2);
}
template <typename T>
inline constexpr bool even(T a) {
  return !bool(a % 2);
}
template <typename T1, typename T2>
inline constexpr T1 smod(T1 x, T2 m) {
  return x > m ? x - m : x + m < m ? x + m : x;
}
vector<int> repetend(vector<int> a) {
  vector<int> p(a.size(), -1);
  for (unsigned i = 0; i < a.size(); i++)
    if (p[i] == -1) {
      int c = 1;
      for (unsigned j = a[i]; j != i; j = a[j]) ++c;
      p[i] = c;
      for (unsigned j = a[i]; j != i; j = a[j]) p[j] = c;
    }
  return p;
}
template <typename T>
inline constexpr T lmiddle(T first, T last) {
  return first + (last - first) / 2;
}
template <typename T>
inline constexpr T rmiddle(T first, T last) {
  return last - (last - first) / 2;
}
template <typename T, typename F>
T dichotomy(T l, T r, F check, T prec = 1) {
  while (r - l > prec) {
    T m = lmiddle(l, r);
    (check(m) ? l : r) = m;
  }
  return l;
}
template <typename T, typename F>
T dichotomy2(T l, T r, F check, T prec = 1) {
  while (r - l > prec) {
    T m = rmiddle(l, r);
    (check(m) ? r : l) = m;
  }
  return r;
}
bool contains(const string &s, const string &t) {
  return s.find(t) != string::npos;
}
template <typename T>
bool contains(const T &s, typename T::value_type t) {
  for (typename T::value_type c : s)
    if (c == t) return true;
  return false;
}
template <typename T>
bool contains(const initializer_list<T> s, T t) {
  return find(s.begin(), s.end(), t) != s.end();
}
}  // namespace Miscelleneous
}  // namespace Infinity
struct Node {
  int val;
  int id;
  Node(int val = 0, int id = 0) : val(val), id(id) {}
};
int main() {
  int n = getint(), m = getint();
  vector<Node> a;
  for (int i : range(n)) {
    a.emplace_back(getint(), i);
  }
  sort(a, [](const Node &n1, const Node &n2) { return n1.val < n2.val; });
  int co = count_if(a.begin(), a.end(),
                    [](const Node &n) { return odd(n.val); }),
      ce = count_if(a.begin(), a.end(),
                    [](const Node &n) { return even(n.val); });
  set<int> occ;
  for (int i : range(n)) {
    occ.insert(a[i].val);
  }
  int no = 1, ne = 2, cc = 0;
  vector<int> ep;
  for (int i : range(n)) {
    if (i != n - 1 && a[i].val == a[i + 1].val) {
      ep.push_back(i);
      if (odd(a[i].val)) {
        --co;
      } else {
        --ce;
      }
    }
  }
  auto nextOdd = [&]() {
    while (occ.count(no)) {
      no += 2;
      if (no > m) {
        throw -1;
      }
    }
    occ.insert(no);
    ++co;
    ++cc;
    return no;
  };
  auto nextEven = [&]() {
    while (occ.count(ne)) {
      ne += 2;
      if (ne > m) {
        throw -1;
      }
    }
    occ.insert(ne);
    ++ce;
    ++cc;
    return ne;
  };
  try {
    for (int p : ep) {
      if (co <= ce) {
        a[p].val = nextOdd();
      } else {
        a[p].val = nextEven();
      }
    }
    if (co != ce) {
      for (int i : range(n)) {
        if (co < ce && even(a[i].val)) {
          --ce;
          a[i].val = nextOdd();
        }
        if (ce < co && odd(a[i].val)) {
          --co;
          a[i].val = nextEven();
        }
      }
    }
    sort(a, [](const Node &n1, const Node &n2) { return n1.id < n2.id; });
    writeln(cc);
    for (int i : range(n)) {
      writeSP(a[i].val);
    }
  } catch (int e) {
    writeln(e);
  }
  return 0;
}
