#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int n, K;
vector<int> V[1000000 + 9];
int ans[1000000 + 9];
int main() {
  read_file();
  while (scanf("%d%d", &n, &K) != EOF) {
    if (3 * K > n) {
      printf("-1\n");
      continue;
    }
    for (int i = 0; i < K; i++) V[i].clear();
    for (int i = 0; i < 3 * K; i++) {
      V[i % K].push_back(i);
    }
    int save = V[K - 1].back();
    for (int i = K - 1; i >= 1; i--) {
      V[i].pop_back();
      V[i].push_back(V[i - 1].back());
    }
    V[0].pop_back();
    V[0].push_back(save);
    for (int i = 3 * K; i < n; i++) V[K - 1].push_back(i);
    for (int i = 0; i < K; i++) {
      int sz = V[i].size();
      for (int j = 0; j < sz; j++) ans[V[i][j]] = i;
    }
    for (int i = 0; i < n; i++) printf("%d%c", ans[i] + 1, " \n"[i == n - 1]);
  }
}
