#include <bits/stdc++.h>
using namespace std;
int n, K, viz[1000005];
int p[1000005];
int main() {
  cin >> n >> K;
  if (n / K <= 2) {
    cout << -1 << "\n";
    return 0;
  }
  int j = 0;
  int cnt = 1;
  for (int i = 1; i <= K; ++i) p[i] = i;
  for (int i = K; i >= 2; --i) {
    int aux = p[i];
    p[i] = p[i - 1];
    p[i - 1] = aux;
  }
  for (int i = 1; i <= K; ++i) viz[i] = p[i];
  for (int i = K + 1; i <= n; ++i) {
    ++j;
    viz[i] = j;
    if (j == K) {
      j = 0;
      ++cnt;
    }
  }
  for (int i = 1; i <= n; ++i) cout << viz[i] << " ";
}
