#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  if ((n / k) < 3) {
    printf("-1\n");
  } else {
    int aver_word = n / k;
    int last_index = aver_word * k;
    int *secret = new int[n];
    if (!secret) {
      printf("Memory allocation failure!\n");
      assert(0);
    }
    for (int i = 0; i != n; i++) {
      int word = i / aver_word;
      secret[i] = (i >= last_index) ? k : (word + 1);
    }
    int odd = k % 2;
    int group = k / 2;
    int base = aver_word;
    for (int i = 0; i != group; i++) {
      int index = base + i * 2 * aver_word;
      int temp = secret[index - 1];
      secret[index - 1] = secret[index];
      secret[index] = temp;
    }
    if (odd) {
      int temp = secret[0];
      secret[0] = secret[n - 1];
      secret[n - 1] = temp;
    } else {
    }
    for (int i = 0; i != n; i++) {
      printf("%d ", secret[i]);
    }
  }
  return 0;
}
