#include <bits/stdc++.h>
using namespace std;
int x[1000100], y[1000100];
int main() {
  int n, k;
  while (cin >> n >> k) {
    memset(x, 0, sizeof(x)), memset(y, 0, sizeof(y));
    int z = 1;
    for (int K = (int)1; K < (int)k + 1; K++) {
      if (z > n) break;
      x[z++] = K, y[K]++;
      if (z > n) break;
      x[z++] = K, y[K]++;
    }
    int K = 0;
    for (int i = (int)z; i < (int)n + 1; i++) {
      x[i] = K + 1, y[K + 1]++;
      K = (K + 1) % k;
    }
    int yes = 1;
    for (int i = (int)1; i < (int)k + 1; i++)
      if (y[k] < 3) yes = 0;
    if (yes) {
      for (int i = (int)1; i < (int)n + 1; i++) cout << x[i] << " ";
      puts("");
    } else
      puts("-1");
  }
  return 0;
}
