#include <bits/stdc++.h>
using namespace std;
int n, k, sol[1000005], iter, i;
bool repite, up;
int main() {
  cin >> n >> k;
  if (n / k < 3)
    cout << "-1" << endl;
  else {
    iter = 1;
    repite = 1;
    up = 1;
    for (i = 1; i <= n; i++) {
      sol[i] = iter;
      if (iter == k && !repite)
        repite = 1;
      else if (iter == k && repite) {
        iter--;
        repite = 0;
        up = 0;
      } else if (iter == 1 && !repite)
        repite = 1;
      else if (iter == 1 && repite) {
        iter++;
        repite = 0;
        up = 1;
      } else if (up)
        iter++;
      else
        iter--;
    }
    for (i = 2; i < k; i += 2) {
      iter = sol[i];
      sol[i] = sol[i + 1];
      sol[i + 1] = iter;
    }
    for (i = 1; i <= n; i++) cout << sol[i] << " ";
    cout << endl;
  }
  return 0;
}
